Database Operations
Zeromagic supports a range of database methods to perform CRUD (Create, Read, Update, Delete) operations on data. Available methods include readOne, readMany, createOne, createMany, updateOne, updateMany, deleteOne, and deleteMany, providing comprehensive support for data management tasks.
Read Operations
readOne
& readMany
The ReadOne and ReadMany both has same syntax but ReadOne returns only single object as dict where ReadMany returns multiple objects as list. The query object must contain the container
and filter
properties. fields
property is optional which returns a particular fields of created records.
Create Operations
createOne
The CreateOne method is used to create a single item in the specified container. The query object must contain the container
and item
properties. fields
property is optional which returns a particular fields of created records.
createMany
The CreateMany method is used to create multiple items in the specified container. The query object must contain the container
and items
properties. fields
property is optional which returns a particular fields of created records.
Update Operations
updateOne
The updateOne method is used to update a single item in the specified container with id
field. The query object must contain the container
, id
and update
properties. fields
property is optional which returns a particular fields of updated records.
updateMany
The updateMany method is used to update multiple item in the specified container. The query object must contain the container
, filter
and update
properties. fields
property is optional which returns a particular fields of updated records.
Delete Operations
deleteOne
The deleteOne method is used to delete a single item in the specified container with id
field. The query object must contain the container
, id
properties. fields
property is optional which returns a particular fields of deleted records.
deleteMany
The deleteMany method is used to delete mutliple items in the specified container. The query object must contain the container
, filter
properties. fields
property is optional which returns a particular fields of deleted records.
Was this page helpful?