# Functions
AddIndex adds an index to collection.
AddIndexes adds indexes to collection.
AddIndexes adds indexes to collection model should be implement `CollName() string`.
AddIndex adds an index to collection model should be implement `CollName() string`.
AddOrUpdate adds or updates one document from collection model should be implement `CollName() string`.
Aggregate aggregates documents based on Pipeline and Options from request.
Aggregate aggregates documents based on Pipeline and Options from request model should be implement `CollName() string`.
No description provided by the author
No description provided by the author
Connect mongodb://localhost:27017/?w=majority&retryWrites=false.
Count counts documents from collection.
CountT counts documents from collection model should be implement `CollName() string`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Delete deletes many documents from collection.
DeleteOne deletes one document from collection.
DeleteOne deletes one document from collection.
Delete deletes many documents from collection.
EstimatedCount counts documents from collection but it is not accurate, still faster than Count.
EstimatedCountT counts documents from collection but it is not accurate, still faster than Count model should be implement `CollName() string`.
FindOne finds one document from model's collection model should be implement `CollName() string`.
Find finds documents from from model's collection model should be implement `CollName() string`.
Flush clears all records of collection and return number of deleted records.
No description provided by the author
ReplaceOne replaces one document from collection upsert = true if you want to upsert or just use mocom.AddOrUpdate.
ReplaceOne replaces one document from collection upsert = true if you want to upsert, or just use mocom.AddOrUpdate model should be implement `CollName() string`.
No description provided by the author
Tx executes a MongoDB transaction based on provided configuration (cfg).
TxOptimal will do the transaction with majority write-concern snapshot read-concern, primary read preference
This should be used when transaction does not contain any read If a nested transaction is detected, then this transaction will be executed with the passed-in context.
UpdateAndReturn updates one document from collection and return the updated document Pass options to return document AFTER or BEFORE the update.
No description provided by the author
UpdateMany updates many documents from collection model should be implement `CollName() string`.
No description provided by the author
UpdateOne updates one document from collection.
# Structs
-------- AGGREGATION --------.
No description provided by the author
No description provided by the author
No description provided by the author
-------- TRANSACTION -------- TransactionConfig, you only need to define the func; the transaction options are not necessary to be defined for simple use cases.