Readonly
$fieldsMap of the fields that exist on the model.
Readonly
bootedWhether the model has been booted.
Optional
Readonly
collectionName of the collection to use.
Optional
Readonly
connectionCustom database connection to use.
Managing computed columns
Add a field on the model.
This is usually done by the @field
decorator.
Optional
options: Partial<FieldOptions>Returns the field options if it exists.
Fetch all documents in the collection.
Optional
options: ModelAdapterOptions<FindOptions<ModelAttributes<InstanceType<ModelType>>>>Count the number of documents in the collection that match the filter.
Optional
options: ModelAdapterOptions<CountDocumentsOptions>Create a new document in the collection.
Optional
options: ModelAdapterOptions<InsertOneOptions>Create many documents in the collection.
Optional
options: ModelAdapterOptions<BulkWriteOptions>Find a document by its id.
Optional
options: ModelAdapterOptions<FindOptions<ModelAttributes<InstanceType<ModelType>>>>Find a document using a key-value pair.
Optional
options: ModelAdapterOptions<FindOptions<ModelAttributes<InstanceType<ModelType>>>>Find a document using a key-value pair. Throw if no document is found.
Optional
options: ModelAdapterOptions<FindOptions<ModelAttributes<InstanceType<ModelType>>>>Find many documents by their ids.
Optional
options: ModelAdapterOptions<FindOptions<ModelAttributes<InstanceType<ModelType>>>>Find a document by its id. Throw if no document is found.
Optional
options: ModelAdapterOptions<FindOptions<ModelAttributes<InstanceType<ModelType>>>>Get the collection object from the MongoDB driver.
Optional
connection: stringReturns a query
Optional
filter: Filter<ModelAttributes<InstanceType<ModelType>>>Optional
options: ModelAdapterOptions<Omit<FindOptions<ModelAttributes<InstanceType<ModelType>>>, ForbiddenQueryOptions>>
Shape of the model static properties.