Created
January 13, 2016 06:33
-
-
Save alcaeus/edee034ed1051ad1267f to your computer and use it in GitHub Desktop.
Show all fields in DBRef objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DBRef.prototype.toString = function () { | |
var r = ['"$ref": ' + tojson(this.$ref), '"$id": ' + tojson(this.$id)]; | |
var o = this; | |
for (var p in o) { | |
if (p !== '$ref' && p !== '$id' && typeof o[p] !== 'function') { | |
var t = typeof o[p]; | |
r.push('"' + p + '": ' + | |
(t == 'object' ? 'object: {...}' : '"' + o[p] + '"')); | |
} | |
} | |
return '{' + r.join(', ') + '}'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment