stockshark-data-access
Advanced tools
Comparing version 1.0.42 to 1.0.43
{ | ||
"name": "stockshark-data-access", | ||
"version": "1.0.42", | ||
"version": "1.0.43", | ||
"main": "./src/index.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -134,2 +134,17 @@ const MongoClient = require('mongodb').MongoClient; | ||
async updateAll(collection, data) { | ||
const coll = this.db.collection(collection); | ||
await coll.updateMany({}, { $set: data }, { multi: true, upsert: false }) | ||
} | ||
async updateMany(collection, filter, data) { | ||
const coll = this.db.collection(collection); | ||
if (this._defined(filter)) { | ||
filter = this._compileFilter(filter) | ||
} | ||
await coll.updateMany(filter, { $set: data }, { multi: true, upsert: false }) | ||
} | ||
async upsertOne(collection, id, data) { | ||
@@ -136,0 +151,0 @@ const coll = this.db.collection(collection); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17417
300