Use XCode Playground to explore the Couchbase Lite Query API
While the Xcode playground demonstrates the queries in swift, given the unified nature of the QueryBuilder API across the various Couchbase Lite platforms, barring language specific idioms, you should be able to map the queries to any of the other platform languages supported in Couchbase Lite.
So, even if you are not a Swift developer, you should be able to leverage the Xcode playground for API exploration. This tutorial makes no assumptions about your familiarity with Swift or iOS Development so even if you are a complete newbie to iOS development, you should be able to follow along this step-by-step guide.
git clone https://github.com/couchbaselabs/couchbase-lite-ios-api-playground
Switch to folder containing the Cartfile
carthage update --platform ios --no-build
CBLQueryTestBed.xcworkspaceusing Xcode12 or above.
cd /path/to/couchbase-lite-ios open CBLQueryTestBed.xcworkspace/
Congratulations on completing this tutorial!
This tutorial walked you through the steps to set up an Xcode playground for testing the Query API in Couchbase Lite 2.x. As a next step, try expanding the playground to include additional queries against a different dataset . Check out the following links for further details on the Query API including a Xcode playground for testing the APIs.
You can watch a video recording of this tutorial here