Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DB contains something like /bookstore/category[@code=01]    'code 'is the key for the list entry but there is also a 'name' attribute

user does NOT know the key value (or even what the key attribute is)


imagine Imagine category has 'name' value. 'SciFi. User The user wants to finds find a category with that name using

...

System COULD find out using models but the path is incomplete for more then than 1 match possible for 'category' in theory. But this might not be needed. Instead, the following steps will be used;


Query Steps

1) looks for xPath that ends with //category[@name='SciFi'] -> 0 results (existing behavior, no new code)

NEW CODE 

2) look for xPath that ends with //category[@Name@name=*] ->  →  (OPTIMISATION STEP - could go straight to step 3)
a) 0 results -> 'name' is NOT the key, continue with step 3
b) 1+ results 'name' is key but value not found, no need to continue!

3) Looks for XPath that ends with //category[@*] AND attributes(jsonb) contains "name='SciFi'"

Note. the part for "attributes(jsonb) contains "name='SciFi'"" has already been implemented for another query

Note. Document limitations and existing cps path.