Thursday, 18 May 2017

How can i pass a whole query to mongoose

I have a something like this:

var query = collection.find(whole_query); //this came like {whole_query}
        query.exec(function (err, docs) {
            if(err) console.log(err);

            docs.forEach(function (item) {
                console.log(item);
            });

mongoose just do: db.collection.find({}) without the var 'whole_query' :c

thanks for you help :)



via sagonzalez

No comments:

Post a Comment