xpress-mongo
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -1,2 +0,2 @@ | ||
import { MongoClient, MongoClientOptions } from "mongodb"; | ||
import { MongoClient, MongoClientOptions, ObjectId } from "mongodb"; | ||
import { XMongoSchemaBuilder, XMongoSchema, XMongoSchemaFn } from "./src/CustomTypes"; | ||
@@ -33,2 +33,2 @@ import is = require("./src/SchemaBuilder"); | ||
declare function RefreshDateOnUpdate(Model: typeof XMongoModel, field: string, ifHasChanges?: boolean): void; | ||
export { is, Joi as joi, Client, XMongoModel, XMongoTypedModel, XMongoDataType, XMongoSchemaBuilder, XMongoSchema, XMongoSchemaFn, omitKeys, pickKeys, omitIdAnd, omitIdAndPick, parseServerUrl, RefreshDateOnUpdate }; | ||
export { is, Joi as joi, Client, XMongoModel, XMongoTypedModel, XMongoDataType, XMongoSchemaBuilder, XMongoSchema, XMongoSchemaFn, omitKeys, pickKeys, omitIdAnd, omitIdAndPick, parseServerUrl, RefreshDateOnUpdate, ObjectId }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RefreshDateOnUpdate = exports.parseServerUrl = exports.omitIdAndPick = exports.omitIdAnd = exports.pickKeys = exports.omitKeys = exports.XMongoDataType = exports.XMongoTypedModel = exports.XMongoModel = exports.Client = exports.joi = exports.is = void 0; | ||
exports.ObjectId = exports.RefreshDateOnUpdate = exports.parseServerUrl = exports.omitIdAndPick = exports.omitIdAnd = exports.pickKeys = exports.omitKeys = exports.XMongoDataType = exports.XMongoTypedModel = exports.XMongoModel = exports.Client = exports.joi = exports.is = void 0; | ||
const mongodb_1 = require("mongodb"); | ||
Object.defineProperty(exports, "ObjectId", { enumerable: true, get: function () { return mongodb_1.ObjectId; } }); | ||
// Require libs | ||
@@ -6,0 +7,0 @@ const is = require("./src/SchemaBuilder"); |
{ | ||
"name": "xpress-mongo", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"description": "Light Weight ODM for mongoDb", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -187,3 +187,3 @@ import ObjectCollection = require("object-collection"); | ||
*/ | ||
id(): ObjectId | null; | ||
id(): ObjectId; | ||
/** | ||
@@ -308,3 +308,3 @@ * Use custom _id | ||
*/ | ||
static id(str?: any): ObjectId | undefined; | ||
static id(str?: any): ObjectId; | ||
/** | ||
@@ -311,0 +311,0 @@ * Find many in collection |
@@ -897,3 +897,3 @@ "use strict"; | ||
static id(str) { | ||
let _id = str || new mongodb_1.ObjectId(); | ||
let _id = str ? str : new mongodb_1.ObjectId(); | ||
if (typeof str === "string") { | ||
@@ -904,3 +904,3 @@ try { | ||
catch (e) { | ||
return undefined; | ||
throw new Error(`Model.id() Error: ${str} is not a valid ObjectId`); | ||
} | ||
@@ -907,0 +907,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
101286
3165