forked from mongodb-labs/sleepy.mongoose
-
Notifications
You must be signed in to change notification settings - Fork 1
Updating
kchodorow edited this page Sep 14, 2010
·
2 revisions
http://localhost:27080/dbname/cname/_update
Updates an existing document.
POST
Required arguments:
-
criteria=criteria_for_update
(object) -
newobj=modifications
(object)
Optional arguments:
upsert=bool
multi=bool
safe=bool
If safe is false:
{"ok" : 1}
If safe is true:
{"ok" : X, "n" : N, "err" : msg_or_null}
Incrementing a field.
$ curl --data 'criteria={"x":1}&newobj={"$inc":{"x":1}}' 'http://localhost:27080/foo/bar/_update'