xpress-mongo
Advanced tools
Comparing version 2.5.1 to 2.6.0
{ | ||
"name": "xpress-mongo", | ||
"version": "2.5.1", | ||
"version": "2.6.0", | ||
"description": "Light Weight ODM for mongoDb NodeJs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,2 +38,7 @@ import XMongoModel from "./XMongoModel"; | ||
/** | ||
* Alias of .model but to link model classes | ||
* @param model | ||
*/ | ||
linkModel<T extends typeof XMongoModel>(model: T): this; | ||
/** | ||
* Creates a model using current connection | ||
@@ -40,0 +45,0 @@ * @param collection |
@@ -100,2 +100,12 @@ "use strict"; | ||
/** | ||
* Alias of .model but to link model classes | ||
* @param model | ||
*/ | ||
linkModel(model) { | ||
const collectionName = model.collectionName; | ||
if (!collectionName) | ||
throw new Error(`Collection name is not defined in model ${model.name}`); | ||
return this.link(model, collectionName); | ||
} | ||
/** | ||
* Creates a model using current connection | ||
@@ -102,0 +112,0 @@ * @param collection |
@@ -78,2 +78,6 @@ import ObjectCollection from "object-collection"; | ||
/** | ||
* Model Collection Name | ||
*/ | ||
static collectionName: string; | ||
/** | ||
* Model Constructor | ||
@@ -80,0 +84,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
104027
3202