Prebuilt couchbase lite database from json files


#1

We have lot of docs, instead of over stress of our sync gateway and network, we want to load initial data to couchbase lite via a different process. We will unload the files from couchbase server and load them to couchbase lite and keep same revision number as in server, but every time I update the doc in couchbase lite, it’s rev increased. How do I manually set revision number to the same revision number come with doc?


#2

Which SDK are you using? With the native or Couchbase Lite REST API?

CBL 1.3 will have a new API to force insert existing revisions in the database. It’s called putExistingRevisionWithProperties and is implemented in all SDKs. The description can be found here.

You can already start using 1.3 which is in developer preview.

James


#3

You can package an existing CBL database inside your app and install it on first launch. This would be much, much faster than adding all the documents from a JSON file.