How to use allDocsMode query

5 views
Skip to first unread message

parvez....@decurtis.com

unread,
Jul 19, 2017, 12:24:19 PM7/19/17
to Couchbase Mobile
For a bucket containing documents of say type "A", "B", "C". How can we make use of allDocsMode on CBLLiveQuery to get documents of type "A" & "B" in order to delete them? Do we have to create a CBLView also in this case (I think)?
The intention is to be able to delete documents of particular type from Couchbase lite.

Jens Alfke

unread,
Jul 19, 2017, 12:31:49 PM7/19/17
to mobile-c...@googlegroups.com

On Jul 19, 2017, at 9:24 AM, parvez....@decurtis.com wrote:

For a bucket containing documents of say type "A", "B", "C". How can we make use of allDocsMode on CBLLiveQuery to get documents of type "A" & "B" in order to delete them? Do we have to create a CBLView also in this case (I think)?

allDocsMode is only relevant for queries created by Database.allDocuments.

For what you’re doing, create a view that emits doc.type, then query that.

—Jens
Reply all
Reply to author
Forward
0 new messages