Inserts a new document into the collection.
Arguments:
- None
Return Type:
- Promise<InsertOneWriteOpResult<InferSchemaData<T>>>
Callable Methods:
exec()
: Executes the insert operation.
Summary: Inserts a single document into the collection.
Inserts a single document into the collection.
Arguments:
- None
Return Type:
- Promise<InsertOneWriteOpResult<InferSchemaData<T>>>
Callable Methods:
exec()
: Executes the insert operation.
Summary: Inserts a single document into the collection.
Inserts multiple documents into the collection.
Arguments:
- None
Return Type:
- Promise<InsertWriteOpResult<InferSchemaData<T>>>
Callable Methods:
exec()
: Executes the insert operation.
Summary: Inserts multiple documents into the collection.
Retrieves documents from the collection.
Arguments:
- filter: Filter<InferSchemaData<T>>
Return Type:
- Promise<InferSchemaData<T>[]>
Callable Methods:
where()
: Filters the documents based on a specified condition.exec()
: Executes the find operation.limit()
: Limits the number of documents returned.skip()
: Skips a specified number of documents.sort()
: Sorts the documents by a specified field.
Summary: Retrieves documents from the collection based on a filter.
Retrieves a single document from the collection.
Arguments:
- filter: Filter<InferSchemaData<T>>
Return Type:
- Promise<InferSchemaData<T> | null>
Callable Methods:
where()
: Filters the documents based on a specified condition.exec()
: Executes the find operation.
Summary: Retrieves a single document from the collection based on a filter.
Retrieves a single document from the collection and deletes it.
Arguments:
- filter: Filter<InferSchemaData<T>>
Return Type:
- Promise<FindAndModifyWriteOpResultObject<InferSchemaData<T>>>
Callable Methods:
exec()
: Executes the find and delete operation.
Summary: Retrieves a single document from the collection based on a filter and deletes it.
Retrieves a single document from the collection, updates it, and returns the updated document.
Arguments:
- filter: Filter<InferSchemaData<T>>
- update: UpdateFilter<InferSchemaData<T>>
Return Type:
- Promise<FindAndModifyWriteOpResultObject<InferSchemaData<T>>>
Callable Methods:
exec()
: Executes the find and update operation.
Summary: Retrieves a single document from the collection based on a filter, updates it, and returns the updated document.
Retrieves a single document from the collection, replaces it, and returns the new document.
Arguments:
- filter: Filter<InferSchemaData<T>>
- replacement: InferSchemaData<T>
Return Type:
- Promise<FindAndModifyWriteOpResultObject<InferSchemaData<T>>>
Callable Methods:
exec()
: Executes the find and replace operation.
Summary: Retrieves a single document from the collection based on a filter, replaces it, and returns the new document.
Counts the number of documents in the collection.
Arguments:
- filter: Filter<InferSchemaData<T>>
Return Type:
- Promise<number>
Callable Methods:
exec()
: Executes the count operation.
Summary: Counts the number of documents in the collection based on a filter.
Updates a single document in the collection.
Arguments:
- filter: Filter<InferSchemaData<T>>
- update: UpdateFilter<InferSchemaData<T>>
Return Type:
- Promise<UpdateWriteOpResult>
Callable Methods:
exec()
: Executes the update operation.
Summary: Updates a single document in the collection based on a filter.
Updates multiple documents in the collection.
Arguments:
- filter: Filter<InferSchemaData<T>>
- update: UpdateFilter<InferSchemaData<T>>
Return Type:
- Promise<UpdateWriteOpResult>
Callable Methods:
exec()
: Executes the update operation.
Summary: Updates multiple documents in the collection based on a filter.
Deletes a single document from the collection.
Arguments:
- filter: Filter<InferSchemaData<T>>
Return Type:
- Promise<DeleteWriteOpResultObject>
Callable Methods:
exec()
: Executes the delete operation.
Summary: Deletes a single document from the collection based on a filter.
Deletes multiple documents from the collection.
Arguments:
- filter: Filter<InferSchemaData<T>>
Return Type:
- Promise<DeleteWriteOpResultObject>
Callable Methods:
exec()
: Executes the delete operation.
Summary: Deletes multiple documents from the collection based on a filter.
Replaces a single document in the collection.
Arguments:
- filter: Filter<InferSchemaData<T>>
- replacement: InferSchemaData<T>
Return Type:
- Promise<ReplaceWriteOpResult>
Callable Methods:
exec()
: Executes the replace operation.
Summary: Replaces a single document in the collection based on a filter.
Performs aggregation operations on the collection.
Arguments:
- pipeline: PipelineStage<OptionalUnlessRequiredId<InferSchemaData<T>>[]
Return Type:
- AggregationCursor<InferSchemaData<T>>
Callable Methods:
exec()
: Executes the aggregation operation.allowDiskUse()
: Allows the aggregation operation to use disk storage.cursor()
: Returns a cursor for the aggregation operation.
Summary: Performs aggregation operations on the collection using a pipeline.
Watches for changes in the collection.
Arguments:
- pipeline: PipelineStage<any>[]
Return Type:
- ChangeStream<InferSchemaData<T>>
Callable Methods:
exec()
: Executes the watch operation.on()
: Attaches a listener to the change stream.
Summary: Watches for changes in the collection using a pipeline.
Performs bulk write operations on the collection.
Arguments:
- None
Return Type:
- Promise<BulkWriteOpResultObject>
Callable Methods:
exec()
: Executes the bulk write operation.
Summary: Performs bulk write operations on the collection.
Finds the distinct values for a specified field in the collection.
Arguments:
- field: keyof InferSchemaOutput<T>
- filter: Filter<InferSchemaData<T>>
Return Type:
- Promise<InferSchemaOutput<T>[]>
Callable Methods:
exec()
: Executes the distinct operation.
Summary: Finds the distinct values for a specified field in the collection based on a filter.
Drops the collection.
Arguments:
- None
Return Type:
- Promise<void>
Callable Methods:
exec()
: Executes the drop operation.
Summary: Drops the collection.
Estimates the number of documents in the collection.
Arguments:
- options: EstimatedDocumentCountOptions
Return Type:
- Promise<number>
Callable Methods:
exec()
: Executes the estimated document count operation.
Summary: Estimates the number of documents in the collection.
Checks if the collection is capped.
Arguments:
- None
Return Type:
- Promise<boolean>
Callable Methods:
exec()
: Executes the is capped operation.
Summary: Checks if the collection is capped.
Gets the options of the collection.
Arguments:
- options: OperationOptions
Return Type:
- Promise<any>
Callable Methods:
exec()
: Executes the options operation.
Summary: Gets the options of the collection.
Renames the collection.
Arguments:
- newName: string
- options: RenameOptions
Return Type:
- Promise<MongoClient>
Callable Methods:
exec()
: Executes the rename operation.
Summary: Renames the collection.
Returns the raw MongoDB collection.
Arguments:
- None
Return Type:
- MongoDBCollection<InferSchemaData<T>>
Callable Methods:
- Various MongoDB collection methods.
Summary: Returns the raw MongoDB collection.
Creates an index on the collection.
Arguments:
- key: IndexDefinitionKey<Partial<InferSchemaData<T>>>
- options: IndexDefinitionOptions<InferSchemaData<T>>
Return Type:
- Promise<string>
Callable Methods:
exec()
: Executes the create index operation.
Summary: Creates an index on the collection.
Creates multiple indexes on the collection.
Arguments:
- keys: IndexDefinitionKey<Partial<InferSchemaData<T>>[]
- options: IndexDefinitionOptions<InferSchemaData<T>>
Return Type:
- Promise<string[]>
Callable Methods:
exec()
: Executes the create indexes operation.
Summary: Creates multiple indexes on the collection.
Drops an index from the collection.
Arguments:
- value: string
Return Type:
- Promise<string>
Callable Methods:
exec()
: Executes the drop index operation.
Summary: Drops an index from the collection.
Drops all indexes from the collection.
Arguments:
- options: DropIndexesOptions
Return Type:
- Promise<string[]>
Callable Methods:
exec()
: Executes the drop indexes operation.
Summary: Drops all indexes from the collection.
Lists all indexes on the collection.
Arguments:
- None
Return Type:
- CommandCursor<IndexInformation[]>
Callable Methods:
exec()
: Executes the list indexes operation.forEach()
: Iterates over the index information.
Summary: Lists all indexes on the collection.
Checks if an index exists on the collection.
Arguments:
- name: string
- options: AbstractCursorOptions
Return Type:
- Promise<boolean>
Callable Methods:
exec()
: Executes the index exists operation.
Summary: Checks if an index exists on the collection.
Gets information about the indexes on the collection.
Arguments:
- options: IndexInformationOptions & { full?: boolean; }
Return Type:
- Promise<IndexInformation[]>
Callable Methods:
exec()
: Executes the index information operation.forEach()
: Iterates over the index information.
Summary: Gets information about the indexes on the collection.
Creates a search index on the collection.
Arguments:
- description: SearchIndexDescription
Return Type:
- Promise<string>
Callable Methods:
exec()
: Executes the create search index operation.
Summary: Creates a search index on the collection.
Creates multiple search indexes on the collection.
Arguments:
- descriptions: SearchIndexDescription[]
Return Type:
- Promise<string[]>
Callable Methods:
exec()
: Executes the create search indexes operation.
Summary: Creates multiple search indexes on the collection.
Drops a search index from the collection.
Arguments:
- name: string
Return Type:
- Promise<string>
Callable Methods:
exec()
: Executes the drop search index operation.
Summary: Drops a search index from the collection.
Lists all search indexes on the collection.
Arguments:
- None
Return Type:
- CommandCursor<SearchIndexInformation[]>
Callable Methods:
exec()
: Executes the list search indexes operation.forEach()
: Iterates over the search index information.
Summary: Lists all search indexes on the collection.
Updates a search index on the collection.
Arguments:
- name: string
- description: SearchIndexDescription
Return Type:
- Promise<string>
Callable Methods:
exec()
: Executes the update search index operation.
Summary: Updates a search index on the collection.
- Additional schema modifiers
- Full Schema validation
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.