This repository was archived by the owner on Dec 10, 2018. It is now read-only.
-
Couldn't load subscription status.
- Fork 105
Inserting
kchodorow edited this page Sep 14, 2010
·
1 revision
http://localhost:27080/dbname/cname/_insertInserts one or more documents into a collection.
POST
Required arguments:
-
docs=array_of_docs(array of objects)
Optional arguments:
-
safe=boolean(0 or 1)
{
"status" : {
"ok" : 1,
"err" : null,
"n" : 0
}
"oids" : [
{"$oid" : doc1_id},
{"$oid" : doc2_id},
...
]
}docX_id is a string representation of the inserted id, e.g., “4b9fad111d41c82cae000000”. The “status” field will only be included if you specify “safe”.
Inserting two documents ({"x" : 2} and {"x" : 3}) into the namespace foo.bar.
$ curl --data 'docs=[{"x":2},{"x":3}]' 'http://localhost:27080/foo/bar/_insert'