Skip to content

Commit

Permalink
fixed; display empty docs as {} in log output
Browse files Browse the repository at this point in the history
schemas with _id and id set to false were output as undefined
instead of {}

follow up to #953
  • Loading branch information
aheckmann committed Feb 14, 2013
1 parent 3b78fba commit 9783335
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -1476,9 +1476,10 @@ Document.prototype.toJSON = function (options) {
*/

Document.prototype.inspect = function (options) {
var opts = options && 'Object' == options.constructor.name
? options
: undefined
var opts = options && 'Object' == options.constructor.name ? options :
this.schema.options.toObject ? clone(this.schema.options.toObject) :
{};
opts.minimize = false;
return inspect(this.toObject(opts));
};

Expand Down

0 comments on commit 9783335

Please sign in to comment.