Questions tagged [couchdb-mango]

Simplified query language interface for Apache CouchDB, inspired by MongoDB, and made available on Cloudant service first, and then on Apache CouchDB 2.0.

"Mango" is a MongoDB inspired query language interface for Apache CouchDB. It is designed to provide users a more natural conversion to Apache CouchDB.

It is worth noting that it enables the creation of indexes (a.k.a. 'views'), without having to implement explicitly a map and a reduce functions.

The endpoint added is for the HTTP-URI pattern /dbname/_query and has the following characteristics:

  • the only HTTP method supported is POST,
  • the request Content-Type must be application/json,
  • the response is a single JSON object or array that matches to the single command or list of commands that exist in the request.

Reference: https://github.com/cloudant/mango

92 questions
0
votes
1 answer

Cloudant Search Indexing boolean coming back as a string

I have a search index named _design/filters in Cloudant that has the following: index("active", doc.active, {"store": true, "index": false }); My document looks like this: { "_id": "12345", "active": false } When I do a retrieval I get the active…
bryan
  • 8,879
  • 18
  • 83
  • 166
0
votes
1 answer

Custom unicode sorting order for PouchDB/CouchDB Index (Mango Query)

I am using PouchDB (with a Cloudant remote database) to have a local database in a dictionary web app. I need to have an index with a custom Pashto alphabet order (using Arabic unicode letters). The localdb.find queries with $gte (alphabetically…
Adam D
  • 1,962
  • 2
  • 21
  • 37
0
votes
1 answer

CouchDB POST request using curl hanging

I have CouchDB v2.2.0 installed on a Linux server. I have 5 databases create: das model_attribute_groups mydemo registry verifytestdb I can successfully run a Mango query from Fauxton using the contents of the json file listed below. I can…
0
votes
1 answer

search in uniquely generated document (CouchDb)

My document looks like "milestone": { "afyyjahg4a9cjdr7056s": { "milestone_name": "Silver", "milestone_desc": "this is silver milestone", "target": 100, "reward_value": 100, "is_deleted": 1 }, …
Lokesh Jain
  • 579
  • 6
  • 19
0
votes
0 answers

CouchDB Map syntax

I have documents in CouchDB (v. 2.1.1) as follows: { "xyz": "a", "abc": "def" }, { "xyz": "a", "ghi": "jkl" }, { "xyz": "a", "mno": "pqr" }, { "xyz": "a", "stu": "vwx" }, { "xyz": "a", "bcd": 1000 } If I run a simple map…
jlb333333
  • 371
  • 2
  • 13
0
votes
2 answers

How to check for duplication before creating a new document in CouchDB/Cloudant?

We want to check if a document already exists in the database with the same fields and values of a new object we are trying to save to prevent duplicated item. Note: This question is not about updating documents or about duplicated document IDs, we…
J. Araujo
  • 89
  • 1
  • 8
0
votes
1 answer

Filter a subset of fields when replicating in couchdb

I have some documents I would like to replicate to per user databases but only with a subset of fields on the main document. The "selector" option works great to easily select the docs I need but it does not appear to support the "fields" option. I…
imagio
  • 1,390
  • 2
  • 16
  • 27
0
votes
2 answers

Cloudant/Mango query selector size limits

In our system we need to know if a reference to a specific document ID exists anywhere in the database. (for example to allow/deny deletion) This previously worked fine with a view we created but now we have been asked to do the same thing using…
J. Araujo
  • 89
  • 1
  • 8
0
votes
2 answers

Can't find matching index with CouchDB and sort

I have the following query: { "selector":{ "lastname":{ "$regex":"(?i)[cç][oòóôõöø]" }, "firstname":{ "$gt":null }, "type":"person", "owner":{ "$in":["admin"] } …
Nate
  • 7,606
  • 23
  • 72
  • 124
0
votes
1 answer

how to exclude certain documents from Cloudant (or Mango) query?

I imported the IMDB movies-demo database to my CouchDB instance and am am learning about Mango by utilizing some Cloudant tutorials and references. I wrote this query to identify documents wherein the actor's name is like "bruce". Now I want to…
CarCrazyBen
  • 1,066
  • 5
  • 14
  • 37
0
votes
1 answer

Selector query comparing two fields Cloudant/CouchDB/Mango

I have a CouchDB database, which uses a query language Mango - which seems to be the same as Cloudant's query language. I'm trying to search and compare two fields to each other and only return the relevant results when they're equal. For…
Nihir
  • 344
  • 2
  • 16
0
votes
2 answers

Build couchbdb view to index all documents whose ID starts with various three or four characters?

I'm new to nosql and views. Wondering if someone could show me how to build an index such that it will return all the different documents that apply multiple different keys. An example is below. I have many many documents that all have the naming…
nicholas.reichel
  • 2,260
  • 7
  • 20
  • 28
0
votes
1 answer

CouchDB 2.0 404 on Mango Server - GET /db/_index

I am using CouchDB 2.0 and receiving a 404 when trying to get the index definition on my production database. Similarly, I receive a 400 Bad Request when using POST /db/_find and POST /db/_index against production. These both work on my development…
Doug
  • 14,387
  • 17
  • 74
  • 104
0
votes
1 answer

Cannot create an index, i.e. /{db}/_index not working on 2.0.0

I spent hours to figure out why I cannot use Mango Query features. In Fauxton I can neither add Mango Indexes, neither run a Mango query. For instance, in NodeJS: var PouchDB = require('pouchdb'); PouchDB.plugin(require('pouchdb-find')); var db =…
0
votes
1 answer

Couchdb2 mango/find js api

I have noticed that all the couchdb api helpers don't implement Mango query I have found cradle started working on it, but seems they stoped implementing, nothing on docs about…