@dhyasama/totem-models 10.0.1 → 10.0.2

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/lib/Financials.js CHANGED
@@ -769,7 +769,7 @@ module.exports = function(mongoose, config) {
769
769
  var self = this;
770
770
 
771
771
  self
772
- .update(
772
+ .updateMany(
773
773
  { customer: customerId },
774
774
  { $pull : { snapshots: { uuid : null, submittedOn: null, submittedBy: null } } },
775
775
  { multi : true }
@@ -68,7 +68,7 @@ module.exports = function(mongoose, config) {
68
68
  var self = this;
69
69
 
70
70
  var removeReferences = function removeReferences(callback) {
71
- self.update({}, {
71
+ self.updateMany({}, {
72
72
  $pull: { 'notes' : [noteId] }
73
73
  }, callback);
74
74
  };
@@ -765,7 +765,7 @@ module.exports = function(mongoose, config) {
765
765
  if (!customerId) { return cb(new Error('customerId is required'), null); }
766
766
  if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
767
767
 
768
- let query = self.update(
768
+ let query = self.updateOne(
769
769
  { 'customer': customerId },
770
770
  { $set: { people: [] } },
771
771
  { multi : true }
package/lib/Message.js CHANGED
@@ -71,7 +71,7 @@ module.exports = function(mongoose, config) {
71
71
  const self = this;
72
72
 
73
73
  let removeReferences = function removeReferences(callback) {
74
- self.update({}, {
74
+ self.updateMany({}, {
75
75
  $pull: { 'documents' : [docId] }
76
76
  }, callback);
77
77
  };
@@ -92,7 +92,7 @@ module.exports = function(mongoose, config) {
92
92
  const self = this;
93
93
 
94
94
  let removeReferences = function removeReferences(callback) {
95
- self.update({}, {
95
+ self.updateMany({}, {
96
96
  $pull: { 'notes' : [noteId] }
97
97
  }, callback);
98
98
  };
@@ -1052,7 +1052,7 @@ module.exports = function(mongoose, config) {
1052
1052
  const self = this;
1053
1053
 
1054
1054
  let removeReferences = function removeReferences(callback) {
1055
- self.update({}, {
1055
+ self.updateMany({}, {
1056
1056
  $pull: { 'flags' : [flagId] }
1057
1057
  }, callback);
1058
1058
  };
@@ -1073,7 +1073,7 @@ module.exports = function(mongoose, config) {
1073
1073
  const self = this;
1074
1074
 
1075
1075
  let removeReferences = function removeReferences(callback) {
1076
- self.update({}, {
1076
+ self.updateMany({}, {
1077
1077
  $pull: { 'notes' : [noteId] }
1078
1078
  }, callback);
1079
1079
  };
@@ -1754,7 +1754,7 @@ module.exports = function(mongoose, config) {
1754
1754
  var self = this;
1755
1755
 
1756
1756
  self
1757
- .update(
1757
+ .updateMany(
1758
1758
  { 'filters.customer': customerId },
1759
1759
  { $pull : { 'filters': { 'customer': customerId } } },
1760
1760
  { multi : true }
@@ -1768,7 +1768,7 @@ module.exports = function(mongoose, config) {
1768
1768
  var self = this;
1769
1769
 
1770
1770
  self
1771
- .update(
1771
+ .updateMany(
1772
1772
  { 'valuations.customer': customerId },
1773
1773
  { $pull : { 'valuations': { 'customer': customerId } } },
1774
1774
  { multi : true }
package/lib/Person.js CHANGED
@@ -304,7 +304,7 @@ module.exports = function(mongoose, config) {
304
304
  const self = this;
305
305
 
306
306
  let removePersonNoteReferences = function removePersonNoteReferences(callback) {
307
- self.update({}, {
307
+ self.updateMany({}, {
308
308
  $pull: { 'notes' : [noteId] }
309
309
  }, callback);
310
310
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "10.0.1",
3
+ "version": "10.0.2",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",