Pull Sync in CouchbaseLite

Not necessarily. At the top of the page you linked, it says you can include an _id parameter to specify the document ID.

yes, you are right. my misunderstand.

How to I read the data that is within the document? I have this now
config.db.get(id, function(err, doc){
alert(“id is”+ id);
alert("document is " +doc)

I want to be able to read the json that is in the document object. What is the return type of config.db.get(id, function(err,doc)). How will i be able to consume the json that is returned?

Hi there, how much data can be stored on couchbaselite? What can be the maximum size of data the mobile database can store. Is there a limit on that?

Thanks for the help!
Preethi

No, there are no hard limits. Both the SQLite and ForestDB storage engines can store unlimited amounts of data.

How do we update a document using phonegap/Cordova. I am able to read with get and insert using config.db.get () and config.db.put(id, doc). But update requires revision value correct? How do I get this revision. When I try to access doc._sync.rev, it alerts as undefined. Is there a sample syntax for update through javascript?

doc._sync.rev is server-side’s property,when you get docs from couchbase-lite, it will return the rev info in _revproperty .

The property is _rev with a leading underscore. Generally you don’t need to worry about this because you update a document in place — you get it from the database with the _rev property in it, then update whatever properties you want, then put it back with the _rev intact. Easy.

Have you read the documentation? (See the “Special properties” section at the end.)

I have a generic question about Couchbase/CouchbaseLight. Where can I get the licensing information. Can we use Community Edition/Enterprise Edition in production without purchasing license?
We are bit tight on budget for couple of months and we want to evaluate the feedback in production.

We are evaluating this product over CouchDb and Pouch. We would like to know what are the benefits couchbase/couchbaselite can offer vs Pouch(mobile) and CouchDB(server).

Thank you for all your feedback and reply!

Specific legal requirements are in the license agreement included, but a human readable description is on the website. I’d probably recommend contacting Couchbase directly in a more formal way* since there might be a way to get you what you need to have full enterprise subscription backing while you ramp up. I’m in engineering so that’s not my department or call, but obviously there’s a win-win in getting you deployed and finding out if it’s the right thing for you.

* I’m with Couchbase, but this isn’t formal!

The community edition is released under the Apache open-source license, meaning you can freely use and modify it.

Are there any differences between features available in SyncGateway CE and SyncGateway Enterprise?

Not currently, but in the future there may be additional features in the Enterprise edition (as there are in Couchbase Server.)

Thank you for the reply!

We have to support offline login to the application. We are authenticating with the existing login service that connects to ldap and if the login in successful, we store the credentials in the couchbaselite so that if the device is offline it can use those credentials to login and use the app. If we store this data in couchbaselite, it gets synced on to the couchbaseserver along with the password. Is there a way to not include a field or restrict synching the “password” attrribute to the CouchbaseServer?

Have a look at the TransformationFunction property on the replication class. That might accomplish what you want.

Thank you for your reply. Are you talking about something similar to this where we push the doc based on certain owner type? I see this in android. Do we have a similar Javascript/Cordova/Phonegap representation on this?

db.setFilter(“byOwner”, new ReplicationFilter() {
@Override
public boolean filter(SavedRevision revision, Map<String, Object> params) {
String nameParam = (String) params.get(“name”);
return nameParam != null && nameParam.equals(revision.getProperty(“owner”));
}
});
//
// Set up a filtered push replication using the above filter block,
// that will push only docs whose “owner” property equals “Waldo”:
Replication push = db.createPushReplication(url);
push.setFilter(“byOwner”);
Map<String, Object> params = new HashMap<String, Object>();
params.put(“name”, “Waldo”);
push.setFilterParams(params);

Can you tell me what javascript does the todolite phonegap app use? Is it node.js? I was not sure about the controls that are used in that.

you can use pure javascript,or some frame ,such as jquery/bootstrap etc.
and if you want to some ability to communicate with native, you should install phonegap plugin.

Use a local document; those don’t get replicated. The REST API is just like regular documents except the docID begins with _local/.

No, I don’t think it does :confused: You might be thinking of a push filter function, which can customize which docs get replicated.