On Apr 10, 2014, at 5:45 AM, Ragu Vijaykumar <[email protected]> wrote:

> I was wondering how fetchs work when using the CBLIncremental store. Aren't 
> the NSPredicates written via SQL logic? Is there any specific way we should 
> write filters in NSPredicate for NSFetchRequests for use with the CBL 
> backend? Thanks for your help!

I haven't used that class, and I've only looked through the source code once, 
but I remember that it only implements a subset of the full functionality of 
NSPredicate. You might want to look at the source; it's in one file and the 
sections are pretty clearly grouped using "#pragma mark" lines. The sections on 
"NSPredicate", "Querying" and "Views" are especially interesting.

Looks like one of the limits is that it only supports NSExpression types 
NSConstantValueExpressionType, NSEvaluatedObjectExpressionType, 
NSKeyPathExpressionType, with a comment:
    // not supported yet:
    //    NSFunctionExpressionType,
    //    NSAggregateExpressionType,
    //    NSSubqueryExpressionType = 13,
    //    NSUnionSetExpressionType,
    //    NSIntersectSetExpressionType,
    //    NSMinusSetExpressionType,
    //    NSBlockExpressionType = 19

It will automatically generate views for querying a specific property of a 
specific entity type. I think what happens is that it uses the view for basic 
filtering, and then any further processing in an NSFetchExpression happens at 
runtime by testing every matching doc against the predicate and then evaluating 
the expression.

Hopefully the author (Christian Beer) is reading this and can give more insight 
:)

--Jens

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/F6B7CCDB-1D37-4D57-9717-AC7436A9B3BC%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to