Skip to content
kchodorow edited this page Sep 14, 2010 · 2 revisions

Usage

http://localhost:27080/dbname/cname/_update

Description

Updates an existing document.

Request Types

POST

Arguments

Required arguments:

  • criteria=criteria_for_update (object)
  • newobj=modifications (object)

Optional arguments:

  • upsert=bool
  • multi=bool
  • safe=bool

Return Values

If safe is false:

{"ok" : 1}

If safe is true:

{"ok" : X, "n" : N, "err" : msg_or_null}

Example

Incrementing a field.

$ curl --data 'criteria={"x":1}&newobj={"$inc":{"x":1}}' 'http://localhost:27080/foo/bar/_update'
Clone this wiki locally