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

85 questions
0
votes
1 answer

CouchDB mango ignoring index sort order

I am using Hyperledger Fabric with CouchDB (version 2.2.0, the one that comes with the hyperledger/fabric-couchdb docker image). There is a limitation on Fabric which does not allow to specify sort array for mango queries, so it has to be done with…
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…
ncohen
  • 6,184
  • 19
  • 61
  • 112
0
votes
2 answers

How to fetch records after a particular date

I am trying to fetch the records that has the "effectiveDateOfAction" field greater than Oct'2017. Please find the below 3 records. { "_id": "TRAN001", "_rev": "13-59a53069c1ebd6ecfc23ca1dea0ba28f", "effectiveDateOfAction": "10-30-2018", …
Priyanka
  • 95
  • 1
  • 3
  • 13
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
  • 821
  • 9
  • 23
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
  • 161
  • 2
  • 10
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": { …
Aman
  • 3,100
  • 6
  • 29
  • 57
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…
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
  • 7,656
  • 12
  • 65
  • 136
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,370
  • 1
  • 13
  • 29
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
  • 537
  • 4
  • 15
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
  • 353
  • 2
  • 12
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,053
  • 2
  • 13
  • 22