-
Notifications
You must be signed in to change notification settings - Fork 11
Updates to Mongo Documents
Bindaas supports Update. It is displayed under the Update/Delete API:
Make sure to use the $set flag in the update.
A sample query:
{ "_operation" : "update" , "_operation_args" : { "query" : { 'name' : 'Aman' } , "update": {$set: { 'age' : 79, 'phone': '404 111 7777'}}, "upsert": 'true', "multi" : 'true' } }
A sample output:
Server Response { 'rowsAffected' : 2 , 'operation' : 'update' , 'query' : {"name":"Aman"} , 'upsert': true , 'multi': true }
The progress on this development has been listed under https://github.com/sharmalab/bindaas/issues/19.
In order to update or query a mongo document based on a dictionary (json), simply don't use the quotes around the variable, e.g. "update": {$set: { 'fields' : $fields$ }},
instead of something like "update": {$set: { 'fields' : parse('$fields$') }},