I have tried XQUERY updates that should work but they don't work.
My technique of storing JSON documents is perhaps not traditional.
I have reduced my example to this simple example.
FRIST CREATE DATABASE WITH ONE DOCUMENT:
db:create('geography', json:parse('{ "code": "USA", "name": "United States of America", "birth": 1776 }'), '/country')
THEN ADD ANOTHER DOCUMENT:
db:add('geography', json:parse('{ "code": "CAN", "name": "Canada", "birth": 1867 }'), '/country')
- How can I update either of these documents using 'code' as the unique identifier?
- How can I change the 'name' or 'birth'?
- How can I add a 'population' number?
- How can I delete either of these documents using 'code' as the unique identifier?