Fetching results by sequence number

5 views
Skip to first unread message

Brendan Duddridge

unread,
Sep 10, 2017, 9:40:02 AM9/10/17
to Couchbase Mobile
Hi,

I've got an import routine which reads in a CSV file and creates CBLDocuments.

I'd like to query those documents but ordered by the same order they were imported in.

I know that an all docs query can be ordered by kCBLBySequence, but can I do that with a regular CBLView?

Thanks,

Brendan

Jens Alfke

unread,
Sep 10, 2017, 4:21:03 PM9/10/17
to mobile-c...@googlegroups.com


On Sep 10, 2017, at 6:40 AM, Brendan Duddridge <bren...@gmail.com> wrote:

I know that an all docs query can be ordered by kCBLBySequence, but can I do that with a regular CBLView?

Yes, the `doc` parameter to the map function includes a property for the sequence number … it might be `_localSeq` or `_updateSeq`. Try logging the entire dictionary in your map function, to confirm what the key is.

—Jens
Reply all
Reply to author
Forward
0 new messages