Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

[API] POST

padewitte edited this page Nov 7, 2014 · 1 revision

POST rest/{database}/{collection}

Add the document in body workload in the collection.

Request parameters

Parameter Type Mandatory Comment

{database}

url

yes

database name

{collection}

url

yes

collection name

body

body

no

Json document to be insert

writeConcern

header

no

Write concern to use.

Result

Parameter Type Mandatory Comment

body

body

yes

MongoDB getLastError content.

Examples

Add a document in collection

curl -X POST -d "{'_id' : '1', 'name' : 'Sylvain CHAVANEL'}" http://localhost:8080/kupra/test/col

{
  "serverUsed" : "/127.0.0.1:27017" ,
  "n" : 1 ,
  "connectionId" : 2 ,
  "err" : null ,
  "ok" : 1.0
}
Clone this wiki locally