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

Why do CouchDB views support compaction but mango indexes do not?

As I was reading the CouchDB documentation I found it weird that views needed compaction while mango indexes did not. Are they not essentially the same thing and subject to the same requirement of cleaning out unused or old entries? It seems like an…
NiGHTS
  • 3
  • 3
0
votes
1 answer

Mango index "does not contain a valid index for this query" even when specified manually

I'm trying to efficiently query data via Mango (as that seems to be the only option given my requirements Searching for sub-objects with a date range containing the queried date value), but I can't even get a very simple index/query pair to work:…
David Sulc
  • 25,946
  • 3
  • 52
  • 54
0
votes
1 answer

Searching for sub-objects with a date range containing the queried date value

Let's say we're handling the advertising of various job openings across several channels (newspapers, job boards, etc.). For each channel, we can buy a "publication period" which will mean the channel will advertise our job openings during that…
David Sulc
  • 25,946
  • 3
  • 52
  • 54
0
votes
0 answers

How to use CouchDB Mango query (/db/_find) with an index to select multiple _id keys

I am using CouchDB 3.1.1 to perform Mango queries against a database containing a large number of documents. A very common requirement in my application is to perform queries on a very specific and dynamic set of documents. From what I understand at…
NiGHTS
  • 3
  • 3
0
votes
1 answer

Read quorum in CouchDb for _find and MapReduce queries

The CouchDb documentation indicates that, by default, both reads and writes to single documents are quorum reads and writes (e.g. r=2 and w=2 in a 3-replica system). However, the documentation for _find says r "defaults to 1, in which case the…
Oliver Dain
  • 9,617
  • 3
  • 35
  • 48
0
votes
1 answer

How to select a document if a field contains a substring

I've a movielens database and, for example, to search all the documents who have "Titanic" in the title i run this Mango query: { "selector": { "$or": [ { "Title": { "$regex": "titanic" } …
user7494712
0
votes
0 answers

Russian language in CouchDB

I try to run query in CouchDB 2.3.1 with russian language data using regex and get nothing: { "selector": { "class_name": "cat.patients", "name": { "$regex": "(?i)ИВАНОВА" } } } But this query works: { …
0
votes
1 answer

CouchDB - Mango Query to select records based on complex composite key

I have records with keys looking like this: "001_test_66" "001_testab_54" "002_testbc_88" "0020_tesgdtbc_38" How can I query a couchdb database using Mango queries based on the first part of the key (001 or 002). The fourth one should fail if I…
M Yil
  • 877
  • 1
  • 14
  • 35
0
votes
1 answer

How to find by attribute starting with $

I try to query couchdb server with _find endpoint by attribute, starting with '$' ($ref in my case). But server always returns empty document set. I have couchdb documents like this: { "_id": "59bb208006149f50bb32f76f4900ccfa", "_rev":…
Oleg Orlov
  • 46
  • 3
0
votes
1 answer

Create and query mango index on unknown object key in CouchDB

I have the following object: { "roleAttribution": { "15497490976600-51042": { "teams": [ "e5abb1e962e11a84ff0e41e99103cd90" ], "persons": [ "15124323582330-17269" ] } }, "type": "link", } And…
Nate
  • 7,606
  • 23
  • 72
  • 124
0
votes
1 answer

Can't listen on remote address

so I installed couchdb on my VPS using snap, it only listened on 127.0.0.1 and this was not ok for me as It's not practical to ssh on a production environment, I would like it to listen on my external IP so I set in the /var/snap/couchdb/1/local.ini…
Omar Hussein
  • 1,057
  • 2
  • 13
  • 31
0
votes
0 answers

Specify field in Find query

I'm using PouchDB 7 with the find plugin. I would like to retrieve specific information by using mango query. But when a specific value is inside an object, the previous value is not returned. Example { "selector": { "docType":…
Hiago Souza
  • 171
  • 1
  • 2
  • 12
0
votes
1 answer

How to connect operator $or & $and in couchDb mango?

I have document in witch has field "leader". Leader can be type string or array. For example {leader: "id"} or {leader: ["id"]}. How I can get all document where leader = id; If I use operator $all, I search in array, if use operator $or I search in…
0
votes
1 answer

CouchDB query list not giving any result

I am trying to query in couchDB to filter with code ='hi' { id:1, linked": { "type": "XX", "code": [ "hi", "hello" ] } This is how I am trying: { "selector": { "linked": { "type": "xx", "$elemMatch": { …
Amaresh
  • 3,231
  • 7
  • 37
  • 60
0
votes
1 answer

CouchDB vhosts and URL rewrites for multiple arguments

I've tried reading the CouchDB documentation, but I find it a bit vague in this area (FAUXTON, vhost specification). I've searched and read the responses on stackoverflow for "couchdb vhosts" and "couchdb rewrite url" and tried to apply the advice…