cloudant-labs / cloudant-python

Asynchronous Cloudant / CouchDB interface for Python
http://cloudant-labs.github.io/cloudant-python/
37 stars 17 forks source link

Do I have to specify an ID every time I create a document? #47

Closed bjinwright closed 10 years ago

bjinwright commented 10 years ago

Is this true? If so why?

account = cloudant.Account('my_username')
account.login('myusername','mypassword')

db = account.database('mydb')

doc = db.document('the-id-i-have-to-specify').put(params={'name':'Brian'})
garbados commented 10 years ago

Nope, post will make a POST request that assigns an ID, like this:

doc = db.document('the-id-i-have-to-specify').post(params={'name':'Brian'})