Mocking requests References Database
data`${string}.json` | Record<string, unknown>
routes?`${string}.json` | Record<`/${string}`, `/${string}`>
The ORM type is determined by the structure of your database. If a database is an array where each element has an id property, it uses NestedOrm. Otherwise, it uses ShallowOrm.
Used for non-array database fields or arrays without id properties.
update(data: Item) => void
Used for array database fields where each element has an id property. Provides full CRUD operations.
create(item: Omit<Item, "id">) => Item
createMany(items: Omit<Item, "id">[]) => void
delete(id: StorageIndex) => void
deleteMany(ids: StorageIndex[]) => void
exists(filters: Partial<Item>) => boolean
findById(id: StorageIndex) => Item | undefined
findFirst(filters?: Partial<Item>) => Item | undefined
findMany(filters?: Partial<Item>) => Item[]
update(id: StorageIndex, item: Partial<Omit<Item, "id">>) => void
updateMany(ids: StorageIndex[], item: Partial<Omit<Item, "id">>) => number