Global CBlite connection set up

23 views
Skip to first unread message

Preethi SrinivasaMurthy

unread,
Apr 26, 2016, 11:42:33 PM4/26/16
to Couchbase Mobile
Hi all,

We are using reactJs with CBLite. Can you tell me where we need to set up the Cblite connection. How can we make sure the config object CbLite object is accessible everywhere in the application?

Message has been deleted

James Nocentini

unread,
Apr 28, 2016, 2:34:33 AM4/28/16
to Couchbase Mobile
Are you using the Couchbase Lite PhoneGap plugin? On which platform?

If so, the database url is accessible in the onDeviceReady through:

cblite.getURL(function(err, url) {…});

From there you can perform CRUD operation, queries and replication operations on the REST API.

I also suggest to check out the react native couchabse lite plugin https://github.com/couchbaselabs/react-native-couchbase-lite. Reactjs and react native are very similar in the api and with react native you get the native look and feel.

James
Reply all
Reply to author
Forward
0 new messages