The Response of Pull Replication

Hi,
I am new to couchbase, working on an android app.

When a client wants to learn a phone number is registered in the server or not (Every registered number has a document with a channel named that number); which way would be better?

1.
An approach like;
pull.channels(phoneNo);
when pull stops {
make a view of local documents
make a query for (phoneNo)
if.found
return (“registered!”)
}

2.
Make a document of registered numbers and keep it always syncd, pull it from all clients and search that document locally…

3.
Any method returning the results of pull replication? The ids of pulled docs perhaps… I found that .getDocIds() is just for push replications. Is there a similar way?

Maybe you can query the number documents by View/N1QL of CB from client online.

The most efficient way would be to set up an app server that can run a query (or just get the doc with that phone number) and report back to the client.

(You do NOT want to give the client direct access to running view or N1QL queries! That would probably expose way too much information publicly.)

1 Like