I want to use runCommand in mongoDB while using mongoskin -


i want use runcommand in mongodb while using mongoskin. doing this:

app.get('/api/powders', function(req, res, next) {   db.collection('powders').find({} ,{limit:0, sort: [['_id',-1]]}).toarray(function(e, results){     if (e) return next(e)     res.send(results)   }) }) 

it's equals

db.powders.find() 

but want function me this

db.runcommand({distinct: "powders", key: "color"}) 

can me or alternative, thanks!

use db.command().

db.command( { distinct: "powders", key: "color" }, function( err, result ) {     // ... }); 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -