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

Method isEmpty

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

Returns true if the collection has no items. Throws if the collection is not initialized.

()

Source from the content-addressed store, hash-verified

343
344 /** Returns true if the collection has no items. Throws if the collection is not initialized. */
345 isEmpty(): boolean {
346 this.checkInitialized();
347 return this.count() === 0;
348 }
349
350 /** Returns whether this collection should be included in serialization based on its populated state. */
351 shouldPopulate(populated?: boolean): boolean {

Callers 4

validateEmptyWhereFunction · 0.45
populateMethod · 0.45
findChildrenMethod · 0.45

Calls 2

checkInitializedMethod · 0.95
countMethod · 0.95

Tested by

no test coverage detected