insert(data) | Create a new document with the provided data. | data: obj |
create(data) | Alias for the insert method. | data: obj |
insertMany(data) | insertMany method used to insert documents into the database collection. | data: obj[] |
update(data) | Update a single document that matches a given query. | data: obj |
updateMany(data) | Update multiple documents that match a given query. | data: obj |
delete() | Delete a single document that matches a given query. | - |
deleteMany() | Delete multiple documents that matches a given query. | - |
destroy(ids) | Delete one or multiple documents by ids | ids: id or id[] |
select(columns) | Select specific columns to be displayed in the query results. | columns: str or str[] |
exclude(columns) | Exclude specific columns from being displayed in the query results. | columns: str or str[] |
all() | Retrieve all of the records from the model's associated database collection. | - |
get(columns) | Get the documents matching the query criteria. | columns: str or str[] |
first(columns) | Get the first document matching the query criteria. | columns: str or str[] |
find(id) | Find a document by its ID. | id: str or ObjectId |
pluck(column) | Retrieve the values of a specific column from the query results. | column: str |
where(column, operator, value) | Add a WHERE clause to the query. | column: str , operator: str , value: any |
orWhere(column, operator, value) | Add an OR WHERE clause to the query. | column: str , operator: str , value: any |
whereIn(column, values) | Add a WHERE IN clause to the query. | column: str , values: any[] |
orWhereIn(column, values) | Add an OR WHERE IN clause to the query. | column: str, values: any[] |
whereNotIn(column, values) | Add a WHERE NOT IN clause to the query. | column: str , values: any[] |
orWhereNotIn(column, values) | Add an OR WHERE NOT IN clause to the query. | column: str , values: any[] |
whereBetween(column, values) | Add a WHERE BETWEEN clause to the query. | column: str , values: int[] |
orWhereBetween(column, array values) | Add an OR WHERE BETWEEN clause to the query. | column: str , values: int[] |
orderBy(column, direction?, isSensitive?) | Sort the query results by a specific column. | column: str , direction: str , isSensitive: bool |
groupBy(column) | Group the query results by specific columns. | column: str |