Sunday, 15 July 2012

node.js - MongoDb Mongoose .exec() can not get results to console -



node.js - MongoDb Mongoose .exec() can not get results to console -

> cpu.findone({}).sort({_id: -1}).limit(1).exec(function (err, huh) { ... if (err) homecoming handleerror(err); ... console.log(huh.status); ... console.log("hi"); ... }) { domain: null, _events: { err: [function], complete: [function] }, _maxlisteners: 10, emitted: {}, ended: false }

how document found printed console in string format? object instead.

edit:

> cpu.findone({}).sort({_id: -1}).limit(1).exec(function (err, result) { console.log(err) }) { domain: null, _events: { err: [function], complete: [function] }, _maxlisteners: 10, emitted: {}, ended: false } >

as dylants above has stated, mongoose can not correctly print console when ran node shell.

node.js mongodb mongoose

No comments:

Post a Comment