Mongo db with mongojs


#1

I Use Mongodb with mongojs, I used db..distinct but i’ve got error :slight_smile:received a POST Request From Vehicle Distinct ve_brand
/home/ubuntu/workspace/node_modules/mongojs/node_modules/mongodb/lib/utils.js:98
process.nextTick(function() { throw err; });
^

TypeError: cb is not a function
at /home/ubuntu/workspace/node_modules/mongojs/lib/collection.js:69:5
at handleCallback (/home/ubuntu/workspace/node_modules/mongojs/node_modules/mongodb/lib/utils.js:96:12)
at Object.cb (/home/ubuntu/workspace/node_modules/mongojs/node_modules/mongodb/lib/db.js:310:5)
at /home/ubuntu/workspace/node_modules/mongojs/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:446:18
at authenticateStragglers (/home/ubuntu/workspace/node_modules/mongojs/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:402:16)

coding :
app.get(’/vehicle_type_distinct’, function(req, res){
console.log(’***** Vehicle Type Distinct From Node ********’);
console.log(‘received a GET Request From Vehicle Distinct ve_brand’);
db.vehicle_type.distinct(‘vehicle_brand’, function(err, docs){
console.log(docs);
res.json(docs);
});
});

But when i use with my desktop is ok running well, please any one can help