0

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 it. https://github.com/flatiron/cradle/blob/master/lib/cradle/database/mango.js

Is there a good js api that supports mango find?

Secondary: Is there a reason why no one seems to be implementing mango query, why is everyone sticking to map/reduce?

Based on the comments give, I would like to clarify my question: I know about pouch-find, but I presume this is for local storage or local instance of pouch that could be found in browser or nodejs, but I want to find a library that I can use to query couchdb database on the server.

I have found a temporary solution for now. Im using cradle with query function ex:

db.query({
            method: 'POST',
            path: "/_find",
            body: {
                selector:{"_id": "settings/12345" },
                limit:1,
                //use_index: "_all_docs"
            }
        }

So to further explain my setup. Im using one couchdb per user. That db will sync to browser using pouchdb, I can use pouch-find to query that synced local copy (Is this correct?).

But then I have other couch databases that are not synced, that can be accessed by many users. To query these databases I use cradle with the above example.

Flimzy
  • 60,850
  • 13
  • 104
  • 147
Mike Zak
  • 105
  • 7

1 Answers1

1

You can find pouchdb-find here which is in development. If there is no api helpers for Mango Query yet, it's probably because it`s new altough cloudant had this query language since a moment.

Alexis Côté
  • 3,535
  • 2
  • 11
  • 30
  • thanks, pouchdb-find is what led me to couch mango, but what I'm looking for is js API to use with nodejs, I should maybe change my question to be more specific , but thanks – Mike Zak Feb 01 '17 at 02:42
  • Hum, you can us PouchDB aswell as Pouchdb-find in node.js. I don`t really understand that your question is. – Alexis Côté Feb 01 '17 at 23:14