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

Method buildWhereForId

packages/repository/src/model.ts:500–511  ·  view source on GitHub ↗

* Build the where object for the given id * @param id - The id value

(id: any)

Source from the content-addressed store, hash-verified

498 * @param id - The id value
499 */
500 static buildWhereForId(id: any) {
501 const where = {} as any;
502 const idProps = this.definition.idProperties();
503 if (idProps.length === 1) {
504 where[idProps[0]] = id;
505 } else {
506 for (const idProp of idProps) {
507 where[idProp] = id[idProp];
508 }
509 }
510 return where;
511 }
512}
513
514/**

Callers 6

findByIdMethod · 0.80
updateByIdMethod · 0.80
replaceByIdMethod · 0.80
deleteByIdMethod · 0.80
existsMethod · 0.80
model.unit.tsFile · 0.80

Implementers 1

SequelizeModelextensions/sequelize/src/sequelize/seq

Calls 1

idPropertiesMethod · 0.80

Tested by

no test coverage detected