hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Retrive data from database by id

Open metmirr opened this issue 3 years ago • 0 comments

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")

metmirr avatar Apr 29 '21 20:04 metmirr