iOS: Query enhancements, on master branch

56 views
Skip to first unread message

Jens Alfke

unread,
Aug 28, 2014, 6:52:21 PM8/28/14
to mobile-c...@googlegroups.com
I just merged the feature/query branch into master in the couchbase-lite-ios repo. This means that if you build the master branch you'll have some cool new features for your CBLQueries:

• Sorting by criteria other than the key order (using NSSortDescriptor)
• Filtering the result set (using NSPredicate)
• String or array prefix matching, to find things like "keys starting with 'foo'" or "array keys whose first item is 2014".
• inclusiveEnd and inclusiveStart properties (which default to YES but can be set to NO.)

There's a wiki page that describes these in more detail.

These features are planned for the cross-platform public API, but they haven't been through API review yet, so the names might change slightly in the near future. They'll be in the next iOS release (1.0.3?) and hopefully on the other platforms too.

And if you're really into bleeding-edge stuff, there's an experimental class called CBLQueryPlanner that provides a higher-level API for defining views and queries; it's somewhat like Core Data's NSFetchRequest. You can see some examples in its unit tests. This is not close to release, though; it's more of a technology demonstration that we're still figuring out how to integrate with the view engine and public API. If you want to try it out, you'll need to add the source file and header to your app project and build them yourself.

—Jens

Ragu Vijaykumar

unread,
Aug 29, 2014, 1:05:46 PM8/29/14
to mobile-c...@googlegroups.com
I just updated my repo to the latest master branch version, but am getting a compile error in CBLManager.m. I can't find this variable defined anywhere in the source code - where is it supposed to be.

* Undeclared identified MYLoggingCallback
+ (void) redirectLogging: (void (^)(NSString* type, NSString* message))callback {
    MYLoggingCallback = callback;

Jens Alfke

unread,
Aug 29, 2014, 1:31:16 PM8/29/14
to mobile-c...@googlegroups.com

On Aug 29, 2014, at 10:05 AM, Ragu Vijaykumar <ra...@scrxpt.com> wrote:

I just updated my repo to the latest master branch version, but am getting a compile error in CBLManager.m. I can't find this variable defined anywhere in the source code - where is it supposed to be.

Do a "git submodule update" to sync up with the latest MYUtilities sources. (You should do this any time after pulling a repo.)

—Jens

Andrew Tetlaw

unread,
Aug 30, 2014, 6:22:50 AM8/30/14
to mobile-c...@googlegroups.com
This is really good news, we've been rolling our own so far. These will be a welcome addition.
Reply all
Reply to author
Forward
0 new messages