Can I save a document with my defined _id and _rev in CBL?

30 views
Skip to first unread message

Pankaj Jakhar

unread,
Jun 3, 2014, 3:10:35 AM6/3/14
to mobile-c...@googlegroups.com
I want to save a new document in CBL with custom _id and custom _rev for the very first time.

Syncing to CBLite local from CouchDB server runs intermittently that is why I am trying new approach to sync data.

I am going to fetch all the documents on demand. Then after fetching all the documents, I will save them using my code to CBLite local.

I know that I can create new document with user-defined is in CBL.

Can I also save a document for the very first time with my custom revision number?

Traun Leyden

unread,
Jun 3, 2014, 3:49:08 PM6/3/14
to mobile-c...@googlegroups.com
You can specify a custom _id field, but leave the _rev field blank and Couchbase Lite will generate one for you.


--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/2deea262-2f53-4db2-8665-5a392ae107a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages