lightcouch / LightCouch

CouchDB Java API
www.lightcouch.org
Apache License 2.0
67 stars 70 forks source link

Update a document using Lightcouch #45

Closed drmencicg closed 9 years ago

drmencicg commented 9 years ago

Hi! I don't understand how to update a Document, I have this code in CouchDB: "friends": [ "martin", "maja", "damir" ], I was wondering how in android using Lightcouch could I update new friend in friends, I look at Lightcouch API but I have not been success with update. A little example code I beg you, Thanks!

ahmedyha commented 9 years ago

Hi

To update a document in CouchDB, usually you will first retrieve the document, modify, then update.

Foo foo = dbClient.find(Foo.class, "doc-id");
// .. modify "friends" array or list
dbClient.update(foo);

btw, we have a discussion group at http://groups.google.com/group/lightcouch

drmencicg commented 9 years ago

OK! Thank You Sir!

drmencicg commented 9 years ago

Hi! Can you please reply to this post: https://groups.google.com/forum/#!topic/lightcouch/7GbUjkmVYG0

Thanks!