mongo-iots-wrapper
Advanced tools
Comparing version 0.0.9 to 0.0.10
import * as t from 'io-ts'; | ||
import { Db } from 'mongodb'; | ||
import { Db, ObjectId } from 'mongodb'; | ||
import { ExtendableObject } from './Utils'; | ||
@@ -95,4 +95,5 @@ import { errorReporter } from './ErrorReporter'; | ||
findById: async (id: string) => { | ||
const document = (await collection.findOne({ _id: id })) as DOCUMENT; | ||
findById: async (id: string | ObjectId) => { | ||
const objectId = typeof id === 'string' ? new ObjectId(id) : id; | ||
const document = (await collection.findOne({ _id: objectId })) as DOCUMENT; | ||
if (document) { | ||
@@ -99,0 +100,0 @@ errorReporter(document, validator); |
{ | ||
"name": "mongo-iots-wrapper", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Strongly typed MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "dist/Index.js", |
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
73215
1173