@oridune/epic-odm
Advanced tools
Comparing version 1.0.31 to 1.0.32
{ | ||
"name": "@oridune/epic-odm", | ||
"version": "1.0.31", | ||
"version": "1.0.32", | ||
"description": "Install 1 ODM and code once with any database driver.", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -148,2 +148,7 @@ "use strict"; | ||
break; | ||
case "Increment": | ||
Results["$inc"] = { | ||
[Key]: Target.Value, | ||
}; | ||
break; | ||
case "ReplaceWith": | ||
@@ -397,2 +402,8 @@ Results["$replaceWith"] = { | ||
const ModelOptions = (0, model_1.getModelOptions)(model); | ||
// Resolve Dataset | ||
const Dataset = merge ? TransposeToNative([data])[0] : data; | ||
const Incrementor = typeof Dataset["$inc"] === "object" | ||
? { $inc: Dataset["$inc"] } | ||
: undefined; | ||
delete Dataset["$inc"]; | ||
// Create New Document | ||
@@ -402,3 +413,3 @@ const Results = await (await this.getConnectionObject()) | ||
.collection(ModelOptions.getResolvedName()) | ||
.updateMany({ _id: { $in: targets.map((_) => _._id) } }, { $set: merge ? TransposeToNative([data])[0] : data }, { session: connection }); | ||
.updateMany({ _id: { $in: targets.map((_) => _._id) } }, Object.assign({ $set: Dataset }, Incrementor), { session: connection }); | ||
return { updatedCount: Results.modifiedCount }; | ||
@@ -405,0 +416,0 @@ } |
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
149303
3056