I am looking for way to execute string mongodb queries such as :
var q = 'db.collection("restaurants").find({ "address.coord": { $lt: -95.754168 } })';
this.db.eval('function(){ return ' + q + '.toArray(); }', function(err, res){
console.log("the result is", res);
});o
I understand from official MongoDb Documentation that this used to be possible earlier but it's not now.
Is there another way of achieving this?
I understand that I could store query condition and projections in variables and pass it on as dynamic entities. But is it also possible to go all the way dynamic and execute string queries fetched from a database on the fly?
Can I do without such dynamic nature? May be, may be not. But I want to know all my options.