@dhyasama/totem-models 5.1.7 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.npmignore ADDED
@@ -0,0 +1,14 @@
1
+ lib-cov
2
+ *.seed
3
+ *.log
4
+ *.csv
5
+ *.dat
6
+ *.out
7
+ *.pid
8
+ *.gz
9
+
10
+ npm-debug.log
11
+ node_modules
12
+
13
+ .DS_Store
14
+ .idea
package/lib/Document.js CHANGED
@@ -133,6 +133,14 @@ module.exports = function(mongoose, config) {
133
133
  }).exec(cb);
134
134
  };
135
135
 
136
+ Document.statics.upsert = function upsert(doc, cb) {
137
+
138
+ if (!doc) { return cb(new Error('doc is required'), null); }
139
+
140
+ doc.save(cb);
141
+
142
+ };
143
+
136
144
  Document.plugin(postFind, {
137
145
 
138
146
  find: function(results, done) {