Juanjo Conti
Juanjo Conti

Reputation: 30023

Can a JSON data structure be directly saved as a CouchDB document?

I'm a Python programmer with experience using the json module. I've just meet CouchDB and seems very interesting.

I wonder know if JSON data structures can be directly saved as a CouchDB document.

Thanks,

Upvotes: 0

Views: 790

Answers (3)

b_erb
b_erb

Reputation: 21241

You only need to provide an unique ID that will be used as part of the resource name (URI) when PUTting it or you use POST and take an auto-generated ID. You can use any JSON, that does not contain _id and _rev, because these fields are reserved for CouchDB itself.

Upvotes: 3

kern
kern

Reputation: 106

CouchDB will accept any valid JSON Object as a document.

Upvotes: 0

ozk
ozk

Reputation: 2022

couchDB is inteded to work with JSON. have a look here: http://wiki.apache.org/couchdb/HTTP_Document_API#POST you just POST a json document for storage.

Upvotes: 0

Related Questions