Feature: Mango Query

This is the fourth in a series of blog posts introducing the Apache CouchDB 2.0 release. Read parts one, two, and three in the series. 

Two years ago, Cloudant developed a declarative style syntax for creating and querying Cloudant indexes. The idea was to attract users who were not familiar with Map-Reduce and Javascript but still wanted to experience the power of NOSQL databases. Moreover, the syntax was MongoDB-inspired, meaning that users already familiar with MongoDB’s find() operator could easily transition over to Cloudant’s new declarative API. Cloudant introduced this feature as Cloudant Query. Within a few months, Cloudant donated Cloudant Query to CouchDB. We decided to adopt the development codename for introduction to the CouchDB community. Lo and behold: Mango.

For a quick introduction on how to get started with creating and querying indexes using Mango, check out this informative post: Introducing Cloudant Query.

When Mango was first donated to CouchDB, the codebases were identical. However, the repositories diverged as Cloudant added a new text-search feature to Cloudant Query that leveraged Cloudant’s existing full-text-search API. The new text-search feature also made the existing query API more flexible and truly ad-hoc. At the time, Cloudant’s full-text-search was not open sourced, and thus CouchDB’s version could not reap the benefits.

In late July of 2015, Cloudant open sourced full-text-search. This allowed Cloudant Query and Mango Query to become synchronized.

Check out Enable Full Text Search in Apache CouchDB to start using text search with Mango Query.

To fully understand the differences between original Mango JSON indexes and text indexes checkout Mango JSON vs Text Indexes. One of the restrictions of Mango in the past two years was that users had to create an index first before running a query. This was a nuisance to developers who just wanted to execute a query against the database, especially when they encountered the infamous no_index_found error. We’re happy to announce that in CouchDB 2.0, this restriction has been lifted. Users can now execute queries without the need to create an index first.

 

Tony Sun is a software developer at IBM Cloudant focusing on indexing and core API functionality. He is also a CouchDB committer.


You can download the latest release candidate from http://couchdb.apache.org/release-candidate/2.0/. Files with -RC in their name a special release candidate tags, and the files with the git hash in their name are builds off of every commit to CouchDB master.

We are inviting the community to thoroughly test their applications with CouchDB 2.0 release candidates. See the testing and setup instructions for more details.

10 thoughts on “Feature: Mango Query

  1. CouchDB Weekly News, August 4, 2016 – CouchDB Blog

  2. Release Candidates – CouchDB Blog

  3. Feature: Compaction – CouchDB Blog

  4. Feature: Replication – CouchDB Blog

  5. Migrating to CouchDB 2.0 – CouchDB Blog

  6. Check out The Road to CouchDB 2.0 series – CouchDB Blog

  7. 2.0 – CouchDB Blog

  8. Introduction to CouchDB with .NET part 9: starting with view design documents | Exercises in .NET with Andras Nemes

  9. CouchDB Developer Profile: Joan Touzet – CouchDB Blog

  10. Get up to speed on CouchDB 2.0 in 45 minutes – CouchDB Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s