How to fetch a particular document?

5 views
Skip to first unread message

parvez....@decurtis.com

unread,
Aug 3, 2017, 12:26:43 PM8/3/17
to Couchbase Mobile
For a couchbase lite based ios application, is it possible to fetch a single document of a particular type and that too without using documentID? The document to be matched & returned may be on the basis of some other field for example email. Is it possible without query/view? I think I need to take help of couchbase rest api in this case, right?


Jens Alfke

unread,
Aug 3, 2017, 9:00:34 PM8/3/17
to Couchbase Mobile

On Aug 3, 2017, at 9:26 AM, parvez....@decurtis.com wrote:

For a couchbase lite based ios application, is it possible to fetch a single document of a particular type and that too without using documentID? The document to be matched & returned may be on the basis of some other field for example email. Is it possible without query/view? 

What you’re describing is a query. (Not just according to CBL, but any database.) So yes, you have to use a query to do this.

 I think I need to take help of couchbase rest api in this case, right?

I’m not sure what you mean here. The native (Cocoa) API has views and queries; look at the CBLView and CBLQuery classes.

—Jens
Reply all
Reply to author
Forward
0 new messages