xpress-mongo
Advanced tools
Comparing version 2.11.0 to 2.12.0
{ | ||
"name": "xpress-mongo", | ||
"version": "2.11.0", | ||
"version": "2.12.0", | ||
"description": "Light Weight ODM for mongoDb NodeJs", | ||
@@ -36,3 +36,3 @@ "main": "index.js", | ||
"joi": "^17.6.0", | ||
"mongodb": "4.8.1", | ||
"mongodb": "4.9.0", | ||
"object-collection": "^3.0.1", | ||
@@ -43,3 +43,3 @@ "uuid": "^8.3.2" | ||
"@types/chance": "^1.1.3", | ||
"@types/node": "^18.6.2", | ||
"@types/node": "^18.7.13", | ||
"@types/uuid": "^8.3.4", | ||
@@ -51,3 +51,3 @@ "chance": "^1.1.8", | ||
"ts-node-dev": "^2.0.0", | ||
"typescript": "^4.7.4" | ||
"typescript": "^4.8.2" | ||
}, | ||
@@ -54,0 +54,0 @@ "engines": { |
import XMongoModel from "./XMongoModel"; | ||
import { Collection, Db, MongoClient } from "mongodb"; | ||
import XMongoTypedModel from "./XMongoTypedModel"; | ||
import { StringToAnyObject } from "./types/index"; | ||
declare class XMongoClient { | ||
@@ -47,3 +48,3 @@ client: MongoClient; | ||
*/ | ||
typedModel<DT>(collection: string): XMongoTypedModel<DT>; | ||
typedModel<DT extends StringToAnyObject>(collection: string): XMongoTypedModel<DT>; | ||
/** | ||
@@ -50,0 +51,0 @@ * Link a model to a "collection" |
@@ -293,3 +293,3 @@ import ObjectCollection from "object-collection"; | ||
* Check if a document exists. | ||
* Projects only Id and returns boolean. | ||
* Projects only ID and returns boolean. | ||
*/ | ||
@@ -296,0 +296,0 @@ static exists(query: StringToAnyObject): Promise<boolean>; |
@@ -339,3 +339,3 @@ "use strict"; | ||
/** | ||
* If default value is undefined and schema is required set field to undefined. | ||
* If default value is undefined and schema is required to be set field to undefined. | ||
* else set field to value. | ||
@@ -560,2 +560,4 @@ * | ||
this.$setOriginal(this.data); | ||
// set using custom id to false | ||
this.meta.usingCustomId = false; | ||
// resolve | ||
@@ -592,3 +594,3 @@ resolve(res); | ||
const $unset = {}; | ||
// Change keys to Array if its a string | ||
// Change keys to Array if it's a string | ||
if (typeof keys === "string") | ||
@@ -810,3 +812,3 @@ keys = [keys]; | ||
* Check if a document exists. | ||
* Projects only Id and returns boolean. | ||
* Projects only ID and returns boolean. | ||
*/ | ||
@@ -951,3 +953,3 @@ static async exists(query) { | ||
* options as any is used here because mongodb did not make its new | ||
* WithoutProjection type exportable so we can't make reference to it. | ||
* WithoutProjection type exportable, so we can't make reference to it. | ||
*/ | ||
@@ -970,3 +972,3 @@ return this.native().find(query, options); | ||
* options as any is used here because mongodb did not make its new | ||
* WithoutProjection type exportable so we can't make reference to it. | ||
* WithoutProjection type exportable, so we can't make reference to it. | ||
*/ | ||
@@ -973,0 +975,0 @@ return this.native().findOne(query, options, (error, data) => { |
import XMongoModel from "./XMongoModel"; | ||
import { StringToAnyObject } from "./types/index"; | ||
import { UpdateOptions, UpdateResult } from "mongodb"; | ||
declare class XMongoTypedModel<DT = Record<string, any>> extends XMongoModel { | ||
declare class XMongoTypedModel<DT extends StringToAnyObject = StringToAnyObject> extends XMongoModel { | ||
data: DT; | ||
@@ -6,0 +6,0 @@ set: (key: string | keyof DT | StringToAnyObject | Record<keyof DT | string, any>, value?: any) => this; |
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
113195
3475
+ Addedmongodb@4.9.0(transitive)
- Removedmongodb@4.8.1(transitive)
Updatedmongodb@4.9.0