MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / getIdObject

Method getIdObject

packages/repository/src/model.ts:486–494  ·  view source on GitHub ↗

* Get the identity as an object, such as `{id: 1}` or * `{schoolId: 1, studentId: 2}`

()

Source from the content-addressed store, hash-verified

484 * `{schoolId: 1, studentId: 2}`
485 */
486 getIdObject(): Object {
487 const definition = (this.constructor as typeof Entity).definition;
488 const idProps = definition.idProperties();
489 const idObj = {} as any;
490 for (const idProp of idProps) {
491 idObj[idProp] = (this as AnyObject)[idProp];
492 }
493 return idObj;
494 }
495
496 /**
497 * Build the where object for the given id

Callers 2

getIdMethod · 0.95
model.unit.tsFile · 0.45

Implementers 1

SequelizeModelextensions/sequelize/src/sequelize/seq

Calls 1

idPropertiesMethod · 0.80

Tested by

no test coverage detected