new Model(collectionName, fieldOptionsopt, indexOptionsopt, otherOptionsopt)
Creates an instance of the Model class.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
collectionName |
string | The name of the MongoDB collection. |
||
fieldOptions |
Array.<FieldOptions> |
<optional> |
[] | An array of field options specifying the schema. |
indexOptions |
Array.<IndexOptions> |
<optional> |
[] | An array of index options specifying the indexes. |
otherOptions |
OtherOptions |
<optional> |
Additional options for the model. |
Throws:
-
If the provided field options include reserved names like 'createdAt' or 'updatedAt'.
- Type
- Error
Members
$queryBuilder
The QueryBuilder
instance