mongo-iots-wrapper
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -15,3 +15,3 @@ import * as t from 'io-ts'; | ||
*/ | ||
insertOne: (document: D) => Promise<void>; | ||
insertOne: (document: D) => Promise<D | null>; | ||
@@ -81,3 +81,8 @@ /** | ||
errorReporter(document, validator); | ||
await collection.insert(document); | ||
const newDocumentContainer = await collection.insertOne(document); | ||
const newDocument = (await collection.findOne({ _id: newDocumentContainer.insertedId })) as DOCUMENT; | ||
if (newDocument) { | ||
errorReporter(newDocument, validator); | ||
} | ||
return newDocument; | ||
}, | ||
@@ -84,0 +89,0 @@ |
@@ -24,3 +24,3 @@ import { MongoClient } from 'mongodb'; | ||
const x = 'NotANumber' as any; | ||
mongoClient.Collections.users.insertOne({ | ||
const a = mongoClient.Collections.users.insertOne({ | ||
dateCreated: x, | ||
@@ -30,2 +30,3 @@ email: 'dasds', | ||
}); | ||
console.log(a); | ||
@@ -32,0 +33,0 @@ // TEST DOCUMENTS |
{ | ||
"name": "mongo-iots-wrapper", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Strongly typed MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "dist/Index.js", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
37795
14
430