Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed; setting object root to null/undefined

  • Loading branch information...
commit 75c3277b70a5324e0e490882d0a8a20338c80a12 1 parent 89a968b
@aheckmann aheckmann authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/mongoose/document.js
View
5 lib/mongoose/document.js
@@ -187,7 +187,10 @@ Document.prototype.pre = function (method, fn) {
*/
Document.prototype.set = function (path, val) {
- if (typeof path != 'string') {
+ if ('string' !== typeof path) {
+
+ if (null === path || undefined === path)
+ return this.set(val, path);
var prefix = val
? val + '.'
Please sign in to comment.
Something went wrong with that request. Please try again.