Closed GoogleCodeExporter closed 9 years ago
In-place updates will be expressed through an "update" document, describing
document modifications with a simple syntax as follows:
- The * field contains an object with fields/values to replace.
Example: {"field":"value1"} -> {"*":{"field":"value2"}} -> {"field":"value2"}
- The + field contains an object with fields/values to add.
Example: {"field1":"value1"} -> {"+":{"field2":"value2"}} ->
{"field1":"value1","field2":"value2"}
- The - field contains an array with field names to remove.
Example: {"field":"value"} -> {"-":["field"]} -> {}
- Fields whose name refers to an array will add contained items if the first
item is a + sign.
Example: {"field":["value1"]} -> {"field":["+","value2"]} ->
{"field":["value1","value2"]}
- Fields whose name refers to an array will remove contained items if the first
item is a - sign (only works with strings, meaning you can't remove other type
of items from arrays).
Example: {"field":["value"]} -> {"field":["-","value"]} -> {"field":[]}
- Fields whose name refers to an object will evaluate this rules over the
contained object.
Example: {"field":{"field1":"value1"}} -> {"field":{"+":{"field2":"value2"}}}
-> {"field":{"field1":"value1","field2":"value2"}}
Original comment by sergio.b...@gmail.com
on 19 Jan 2011 at 7:08
Changed the issue summary to reflect the use of "merge" to denote the new
operation.
Original comment by sergio.b...@gmail.com
on 20 Jan 2011 at 5:18
Implemented with "merge" syntax as described above.
Original comment by sergio.b...@gmail.com
on 21 Jan 2011 at 6:19
Original issue reported on code.google.com by
sergio.b...@gmail.com
on 15 Jan 2011 at 5:10