Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mikro-orm

Package Overview
Dependencies
Maintainers
1
Versions
3406
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mikro-orm - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

2

dist/EntityManager.js

@@ -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 };

7

lib/EntityManager.ts

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc