mikro-orm
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -23,3 +23,3 @@ import { ObjectID } from 'bson'; | ||
collection: boolean; | ||
attributes: { | ||
attributes?: { | ||
[attribute: string]: any; | ||
@@ -26,0 +26,0 @@ }; |
@@ -16,5 +16,5 @@ "use strict"; | ||
meta.properties = meta.properties || {}; | ||
meta.properties[propertyName] = Object.assign({}, options); | ||
meta.properties[propertyName] = Object.assign({}, options, { reference: false, collection: false }); | ||
}; | ||
} | ||
exports.Property = Property; |
@@ -39,2 +39,3 @@ import { Collection as MongoCollection, Db, FilterQuery } from 'mongodb'; | ||
addToIdentityMap(entity: BaseEntity): void; | ||
canPopulate(entityName: string, property: string): boolean; | ||
/** | ||
@@ -41,0 +42,0 @@ * @todo improve this for find() operations |
@@ -143,2 +143,6 @@ "use strict"; | ||
} | ||
canPopulate(entityName, property) { | ||
const props = this.metadata[entityName].properties; | ||
return property in props && props[property].reference; | ||
} | ||
/** | ||
@@ -145,0 +149,0 @@ * @todo improve this for find() operations |
@@ -17,4 +17,5 @@ import { FilterQuery } from 'mongodb'; | ||
remove(where: T | any): Promise<number>; | ||
canPopulate(property: string): boolean; | ||
create(data: any): T; | ||
count(where: any): Promise<number>; | ||
} |
@@ -23,2 +23,5 @@ "use strict"; | ||
} | ||
canPopulate(property) { | ||
return this.em.canPopulate(this.entityName, property); | ||
} | ||
create(data) { | ||
@@ -25,0 +28,0 @@ return this.em.create(this.entityName, data); |
@@ -11,1 +11,2 @@ export * from './MikroORM'; | ||
export * from './decorators/hooks'; | ||
export { ObjectID } from 'bson'; |
@@ -16,1 +16,3 @@ "use strict"; | ||
__export(require("./decorators/hooks")); | ||
var bson_1 = require("bson"); | ||
exports.ObjectID = bson_1.ObjectID; |
{ | ||
"name": "mikro-orm", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Simple typescript mongo ORM for node.js based on data-mapper, unit-of-work and identity-map patterns", | ||
@@ -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
98657
2473