hydra
hydra copied to clipboard
Retrive data from database by id
At the moment in the mappings to retrieve a record or multiple records from the database:
await db.get(EntityA, { where: { id: "123" } })
await db.getMany(EntityA, { where: { id: "123" } })
It is common that we see retrieving records by id so we can update our method to accept where
condition and id
:
await db.get(EntityA, "123")