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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -