Skip to content

Commit

Permalink
Merge pull request #2 from joscha/master
Browse files Browse the repository at this point in the history
Fix creation of new documents
  • Loading branch information
drudge committed Dec 5, 2012
2 parents 661afe0 + 6b8c847 commit 3965719
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -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);
});
Expand Down

0 comments on commit 3965719

Please sign in to comment.