Hi there,

Here is the code:

    
CBLQuery *query = [someView createQuery]

 

    query.prefetch = YES; 

    query.startKeyDocID =someDoc.documentID; 

    query.endKeyDocID = someDoc.documentID; 

    query.limit = 1; 

     

    NSMutableArray *rows = [NSMutableArray array]; 

    NSError *__autoreleasing error; 

    for (CBLQueryRow *row in [query run:&error]) { 
            [rows addObject:row]; 
    }


I expected rows to contain only 1 row which is the document id that I am 
looking for, but how it returns all rows from the query. I can filter out 
the documentID from the result, but it seems suboptimal.


Is there anyway just grab one document from a query?


Herman 


-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/781fd0eb-2de3-41b2-9fcb-f6bf59e031e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to