How do I execute a mongo query string on a node server using the native node driver?
I would like to pass a string like "db.users.find ()" to the node server and execute the command. See this question: How do I execute a MongoDB query in a native node-mongo-native driver? there is an answer for the C driver.
Is there a way to do this directly with the native node driver? I tried doing
db.eval('function(){'+query+'}', function(err, result){
console.log("the result is", result
});
and it doesn't work. Appreciate help.
+3
source to share