mikro-orm
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -112,2 +112,4 @@ "use strict"; | ||
const result = await this.getCollection(this.metadata[entity.constructor.name].collection).deleteOne({ _id: entity._id }); | ||
delete this.identityMap[`${entity.constructor.name}-${entity.id}`]; | ||
this.unitOfWork.remove(entity); | ||
this.runHooks('afterDelete', entity); | ||
@@ -114,0 +116,0 @@ return result.deletedCount; |
@@ -12,2 +12,3 @@ import { EntityManager } from './EntityManager'; | ||
clear(): void; | ||
remove(entity: BaseEntity): void; | ||
private computeChangeSet(entity); | ||
@@ -14,0 +15,0 @@ private processReferences(changeSet, meta); |
@@ -30,2 +30,5 @@ "use strict"; | ||
} | ||
remove(entity) { | ||
delete this.identityMap[`${entity.constructor.name}-${entity.id}`]; | ||
} | ||
async computeChangeSet(entity) { | ||
@@ -32,0 +35,0 @@ const ret = { entity }; |
@@ -134,3 +134,4 @@ import { Collection as MongoCollection, Db, FilterQuery } from 'mongodb'; | ||
const result = await this.getCollection(this.metadata[entityName].collection).deleteMany(where); | ||
return result.deletedCount as number; | ||
return result.deletedCount; | ||
} | ||
@@ -141,5 +142,7 @@ | ||
const result = await this.getCollection(this.metadata[entity.constructor.name].collection).deleteOne({ _id: entity._id }); | ||
delete this.identityMap[`${entity.constructor.name}-${entity.id}`]; | ||
this.unitOfWork.remove(entity); | ||
this.runHooks('afterDelete', entity); | ||
return result.deletedCount as number; | ||
return result.deletedCount; | ||
} | ||
@@ -146,0 +149,0 @@ |
@@ -37,2 +37,6 @@ import { Utils } from './Utils'; | ||
remove(entity: BaseEntity): void { | ||
delete this.identityMap[`${entity.constructor.name}-${entity.id}`]; | ||
} | ||
private async computeChangeSet(entity: BaseEntity): Promise<ChangeSet> { | ||
@@ -39,0 +43,0 @@ const ret = { entity } as ChangeSet; |
{ | ||
"name": "mikro-orm", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"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
115372
2865