Versions Compared

Key

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

...

When we try to query the entire list, we get DataNodeNotFound exception because there is no data node with the xpath representing a list in the database. Ex: /bookstore/categories

"id""xpath""attributes"

"parent_id"

200"/bookstore/categories[@book-category='Kids']""{""name"": ""Kids book"", ""price"": 5000, ""stock"": true, ""book-category"": ""Kids""}"

198

199"/bookstore/categories[@book-category='SciFi']""{""name"": ""Test book"", ""price"": 1000, ""stock"": false, ""book-category"": ""SciFi""}"198
198"/bookstore""{""store-name"": ""My Bookstore"", ""store-owner"": ""ABC""}"null


Code Block
titleOld query
WHERE anchor_id = :anchorId AND xpath = ANY (:xpaths)

...

And this would return 2 fragments as follows.

"id""xpath""attributes"

"parent_id"

200"/bookstore/categories[@book-category='Kids']""{""name"": ""Kids book"", ""price"": 5000, ""stock"": true, ""book-category"": ""Kids""}"

198

199"/bookstore/categories[@book-category='SciFi']""{""name"": ""Test book"", ""price"": 1000, ""stock"": false, ""book-category"": ""SciFi""}"198

Impact on response body

The updated query returns child fragments when querying the entire list and it has the following impacts when compared to the existing response body.

...

Code Block
titleCurrent Response
collapsetrue
[
    {
        "stores:bookstore": {
            "categories": [
                {
                    "name": "Test book",
                    "price": 1000,
                    "stock": false,
                    "book-category": "SciFi"
                },
                {
                    "name": "Kids book",
                    "price": 5000,
                    "stock": true,
                    "book-category": "Kids"
                }
            ],
			"store-name": "My Bookstore",
            "store-owner": "ABC"
        }
    }
]

...

Code Block
titleResponse when retrieving whole list
collapsetrue
[
    {
        "stores:categories": {
            "name": "Test book",
            "price": 1000,
            "stock": false,
            "book-category": "SciFi"
        }
    },
    {
        "stores:categories": {
            "name": "Kids book updated",
            "price": 5000,
            "stock": true,
            "book-category": "Kids"
        }
    }
]

...

Code Block
titleResponse with Query API
collapsetrue
[
    {
        "stores:categories": {
            "name": "Test book",
            "price": 1000,
            "stock": false,
            "book-category": "SciFi"
        }
    },
    {
        "stores:categories": {
            "name": "Kids book updated",
            "price": 5000,
            "stock": true,
            "book-category": "Kids"
        }
    }
]

...