mikro-orm
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -64,3 +64,3 @@ "use strict"; | ||
}); | ||
return this[prop] = new Collection_1.Collection(props[prop], this, items); | ||
return this[prop].set(items); | ||
} | ||
@@ -67,0 +67,0 @@ this[prop] = data[prop]; |
@@ -16,2 +16,3 @@ import { ObjectID } from 'bson'; | ||
add(...items: T[]): void; | ||
set(items: T[]): void; | ||
remove(...items: T[]): void; | ||
@@ -18,0 +19,0 @@ removeAll(): void; |
@@ -61,2 +61,6 @@ "use strict"; | ||
} | ||
set(items) { | ||
this.removeAll(); | ||
this.add(...items); | ||
} | ||
remove(...items) { | ||
@@ -63,0 +67,0 @@ this.checkInitialized(); |
@@ -84,3 +84,3 @@ import { getMetadataStorage, getEntityManager } from './MikroORM'; | ||
return this[prop] = new Collection(props[prop], this, items); | ||
return (this[prop] as Collection<BaseEntity>).set(items); | ||
} | ||
@@ -87,0 +87,0 @@ |
@@ -73,2 +73,7 @@ import { ObjectID } from 'bson'; | ||
set(items: T[]): void { | ||
this.removeAll(); | ||
this.add(...items); | ||
} | ||
remove(...items: T[]): void { | ||
@@ -75,0 +80,0 @@ this.checkInitialized(); |
{ | ||
"name": "mikro-orm", | ||
"version": "0.7.1", | ||
"version": "0.7.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", |
@@ -404,3 +404,3 @@ # mikro-orm | ||
Same result can be easily achiever with `BaseEntity.assign()`: | ||
Same result can be easily achieved with `BaseEntity.assign()`: | ||
@@ -413,3 +413,3 @@ ```typescript | ||
console.log(book.title); // 'Better Book 1' | ||
console.log(book.author); // instnace of Author with id: '...id...' | ||
console.log(book.author); // instance of Author with id: '...id...' | ||
console.log(book.author.id); // '...id...' | ||
@@ -416,0 +416,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
145026
3304