CouchDB is a simple find

I have a database couchDB. and I want, as in mongodb, to find one element. something like db.find({user : "John"}) Is this the easiest way to do this?

+5
source share
5 answers

If you have your queries predefined, you can use views to query your database.

It is also possible to use temporary views for special searches, but they are never recommended for use in production, since the index is not saved.

If you need anything else along the lines of full-text search, check out couchdb-lucene .

+4
source

? CouchDB API HTTP. , , , HTTP-, "" .

map/reduce. wiki, . CouchDB guide - .

+1

elasticsearch. couchdb _river . _changes couchdb, .

, elasticsearch ( lucene), RESTful .

"" . , .

, , .

+1

: http://github.com/iriscouch/query_couchdb

(, .)

, API Python Google App Engine.

new Query("User")
    .filter("name =", "John")
    .order('-age')
    .get(function(er, view) {
        if(er)
            throw(er);

        console.log("Got " + view.rows.length + " rows!");
        for(var a = 0; a < view.rows.length; a++) {
            var row = view.rows[a];
            console.log("Row " + a + " = " + JSON.stringify(row));
        }
});

, , .

0

mongo db. Cloudant , mango, MongoDB Apache CouchDB.

Cloudant find({user : "John"}), find({user:{$in : ["Doe", "Smith"]}}) find({"age": {"$gt": 21}}) age > 21

A similar alternative to pouchdb-find is also being developed for the db package.

0
source

All Articles