MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / removeAll

Method removeAll

packages/core/src/entity/Collection.ts:678–686  ·  view source on GitHub ↗

* Remove all items from the collection. Note that removing items from collection does not necessarily imply deleting the target entity, * it means we are disconnecting the relation - removing items from collection, not removing entities from database - `Collection.remove()` * is not the same a

()

Source from the content-addressed store, hash-verified

676 * which tells the ORM we don't want orphaned entities to exist, so we know those should be removed.
677 */
678 removeAll(): void {
679 if (!this.#initialized) {
680 this.#initialized = true;
681 this.#snapshot = undefined;
682 }
683
684 this.remove(this.#items);
685 this.#dirty = true;
686 }
687
688 /**
689 * @internal

Calls 1

removeMethod · 0.95

Tested by

no test coverage detected