Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-1272

Add Contains operation to CPS Path

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Medium Medium
    • Montreal Release
    • None
    • CPS-Core
    • None

      Want to retrieve books that contains pub_year '99' as sub-string of a given value:
      //books[contains(@pub_year,'99')
      This is a requirement for 2E2. 

      Some research shows that the correct expression for using the contains() function is like so

      <cpsPath expression>( contains[@leafname,' <string-value> '])

      To implement this in CPS  and fulfill the use case requirements the following restrictions apply:

      contains() can only be applied to leaves 
      If any of them is equals to ,has the sub string for the given value it is considered a match
       
      A/C

      cpsPath query can be used to select a dataNode based on a leave contains value
      contains() can be used with any data of any type 
      This function should work for leaves in both yang containers as yang lists
      walkthrough code as needed
      demo to team

      Breakdown of tasks

      Update antlr parser to recognize this pattern
      Implement required (native) query
      Add db-container tests for
      filter on string leaf-value
      filter on Integer leaf value
      Update documentation
      demo to team 

            anupriya63 Rudrangi Anupriya
            anupriya63 Rudrangi Anupriya
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: