cypress-mongodb
Advanced tools
Comparing version 2.1.2 to 2.1.3
{ | ||
"singleQuote": true | ||
} |
@@ -0,5 +1,6 @@ | ||
import { ObjectId } from 'mongodb'; | ||
import { MongoDetails } from '../index'; | ||
export declare function insertOne(args: MongoDetails): Promise<import("bson").ObjectID>; | ||
export declare function insertOne(args: MongoDetails): Promise<ObjectId>; | ||
export declare function insertMany(args: MongoDetails): Promise<{ | ||
[key: number]: import("bson").ObjectID; | ||
[key: number]: ObjectId; | ||
}>; |
@@ -58,2 +58,5 @@ "use strict"; | ||
} | ||
if (isNaN(args.pipeline._id) && mongodb_1.ObjectId.isValid(args.pipeline._id)) { | ||
args.pipeline._id = new mongodb_1.ObjectId(args.pipeline._id); | ||
} | ||
return [2, mongodb_1.MongoClient.connect(args.uri).then(function (client) { | ||
@@ -93,2 +96,7 @@ return client | ||
return [2, mongodb_1.MongoClient.connect(args.uri).then(function (client) { | ||
args.pipeline.forEach(function (document, index) { | ||
if (isNaN(document._id) && mongodb_1.ObjectId.isValid(document._id)) { | ||
args.pipeline[index]._id = new mongodb_1.ObjectId(args.pipeline[index]._id); | ||
} | ||
}); | ||
return client | ||
@@ -95,0 +103,0 @@ .db(args.database) |
@@ -0,0 +0,0 @@ Copyright 2021 Jovan Ilić |
{ | ||
"name": "cypress-mongodb", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "Cypress MongoDB plugin", | ||
@@ -35,3 +35,3 @@ "main": "./dist/index.js", | ||
"@types/mongodb": "^4.0.7", | ||
"mocha": "^9.1.3", | ||
"mocha": "^9.2.2", | ||
"prettier": "2.5.1", | ||
@@ -38,0 +38,0 @@ "typescript": "^4.5.2" |
@@ -0,0 +0,0 @@ # Introduction |
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
49582
1018