Company
Date Published
Author
Priya Rajagopal, Senior Director, Product Management
Word count
2209
Language
English
Hacker News points
None

Summary

The new Query interface in Couchbase Lite 2.0 introduces a declarative query language called N1QL, which extends SQL for JSON data. The interface allows for querying of array collections using the `ArrayFunction.contains`, `ArrayFunction.length`, and `in` expressions. These expressions enable filtering, counting, and evaluating members of arrays within documents. Indexing arrays can also be used to speed up read queries, but there are limitations to these capabilities. The new Query API is simpler to use than Map-Views for creating indexes and queries in previous versions of Couchbase Mobile. The interface supports Swift, Android, and Windows platforms with minor tweaks.