Permalink
Browse files

doc should override conditions

  • Loading branch information...
joscha committed Dec 5, 2012
1 parent 661afe0 commit 6b8c8478a51362691ac259c1eb1550b76ed02973
Showing with 3 additions and 3 deletions.
  1. +3 −3 index.js
View
@@ -31,10 +31,10 @@ function findOrCreatePlugin(schema, options) {
callback(err, result, false)
}
} else {
- for (var key in conditions) {
- doc[key] = conditions[key];
+ for (var key in doc) {
+ conditions[key] = doc[key];
}
- var obj = new self(doc)
+ var obj = new self(conditions)
obj.save(function(err) {
callback(err, obj, true);
});

0 comments on commit 6b8c847

Please sign in to comment.