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

Function validateEmptyWhere

packages/core/src/entity/validators.ts:76–80  ·  view source on GitHub ↗
(where: FilterQuery<T>)

Source from the content-addressed store, hash-verified

74
75/** @internal */
76export function validateEmptyWhere<T>(where: FilterQuery<T>): void {
77 if (Utils.isEmpty(where) && !Raw.hasObjectFragments(where)) {
78 throw new Error(`You cannot call 'EntityManager.findOne()' with empty 'where' parameter`);
79 }
80}

Callers 1

findOneMethod · 0.85

Calls 2

hasObjectFragmentsMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected