| |
read source history
= MongoDB Driver Function Reference =
----
This documents lists the functions and keywords implemented in the [[MongoDB driver|robbiblubber.org MongoDB ADO.NET driver]].
The driver implements a subset of MongoDB shell functions as well as driver-specific functionality, especially for using cursors on BSON documents. There may also be differences in function declarations and parameter usage in the functions derived from the MongoDB shell implementation.
**Database commands**
[[[@w
|@t0@r0@c0 [[mongodrv-db|db]] | | Shows the current database. |
| [[mongodrv-show_databases|show databases]] | | Shows a list of all databases in the cluster. |
| [[mongodrv-show_collections|show collections]] | | Shows a list of all collections in the current database. |
| [[mongodrv-use|use]] | | switches the current database. |
]]]
**Database methods**
[[[@w
|@t0@r0@c0 [[mongodrv-db-aggregate|aggregate()]] | | Runs an aggregation without a collection. |
| [[mongodrv-db-createCollection|createCollection()]] | | Creates a collection. |
| [[mongodrv-db-createView|createView()]] | | Creates a view. |
| [[mongodrv-db-dropCollection|dropCollection()]] | | Drops a collection. |
| [[mongodrv-db-dropDatabase|dropDatabase()]] | | Drops a database. |
| [[mongodrv-db-getCollection|getCollection()]] | | Gets a collection. |
| [[mongodrv-db-getName|getName()]] | | Returns the database name. |
| [[mongodrv-db-getSiblingDB|getSiblingDB()]] | | Gets a database. |
| [[mongodrv-db-runCommand|runCommand()]] | | Executes a database command. |
| [[mongodrv-db-serverStatus|serverStatus()]] | | Retrieves server status data. |
| [[mongodrv-db-stats|stats()]] | | Retrieves storage statistics for a database. |
]]]
**Collection methods**
[[[@w
|@t0@r0@c0 [[mongodrv-col-aggregate|aggregate()]] | | Runs an aggregation on a collection. |
| [[mongodrv-col-coundDocuments|countDocuments()]] | | Returns the number of matching documents. |
| [[mongodrv-col-createIndex|createIndex()]] | | Creates an index on the collection. |
| [[mongodrv-col-delete|delete()]] | | Deletes documents from a collection. |
| [[mongodrv-col-deleteOne|deleteOne()]] | | Deletes a single document from a collection. |
| [[mongodrv-col-deleteMany|deleteMany()]] | | Deletes documents from a collection. |
| [[mongodrv-col-distinct|distinct()]] | | Retrieves distinct field values from a collection. |
| [[mongodrv-col-drop|drop()]] | | Drops the collection. |
| [[mongodrv-col-dropAllIndexes|dropAllIndexes()]] | | Drops all indexes on the collection. |
| [[mongodrv-col-dropIndex|dropIndex()]] | | Drops an index on the collection. |
| [[mongodrv-col-estimatedDocumentCount|estimatedDocumentCount()]] | | Returns the count of all documents in a collection. |
| [[mongodrv-col-find|find()]] | | Retrieves documents from a collection. |
| [[mongodrv-col-findOne|findOne()]] | | Retrieves a single document from a collection. |
| [[mongodrv-col-findOneAndDelete|findOneAndDelete()]] | | Deletes a single document based on filter and sort criteria. |
| [[mongodrv-col-findOneAndReplace|findOneAndReplace()]] | | Replaces a single document based on the specified filter. |
| [[mongodrv-col-findOneAndUpdate|findOneAndUpdate()]] | | Updates a single document based on the specified filter. |
| [[mongodrv-col-getIndexes|getIndexes()]] | | Returns all indexes on the collection. |
| [[mongodrv-col-hideIndex|hideIndex()]] | | Hides an index. |
| [[mongodrv-col-index|index()]] | | Creates an index on the collection. |
| [[mongodrv-col-insert|insert()]] | | Inserts documents into a collection. |
| [[mongodrv-col-insertOne|insertOne()]] | | inserts a single document into a collection. |
| [[mongodrv-col-insertMany|insertMany()]] | | Inserts documents into a collection. |
| [[mongodrv-col-remove|remove()]] | | Removes documents from a collection. |
| [[mongodrv-col-replaceOne|replaceOne()]] | | Replaces a single document based on the specified filter. |
| [[mongodrv-col-stats|stats()]] | | Retrieves storage statistics for a collection. |
| [[mongodrv-col-update|update()]] | | Updates documents in a collection. |
| [[mongodrv-col-updateOne|updateOne()]] | | Updates a single document in a collection. |
| [[mongodrv-col-updateMany|updateMany()]] | | Updates documents in a collection. |
| [[mongodrv-col-unhideIndex|unhideIndex()]] | | Unhides an index. |
| [[mongodrv-col-validate|validate()]] | | Validates collection and indexes. |
]]]
**Cursor methods**
[[[@w
|@t0@r0@c0 [[mongodrv-cur-asc|asc()]] | | Sorts the results ascending. |
| [[mongodrv-cur-avg|avg()]] | | Returns the average values for the selected rows. |
| [[mongodrv-cur-count|count()]] | | Counts the results. |
| [[mongodrv-cur-desc|desc()]] | | Sorts the results descending. |
| [[mongodrv-cur-distinct|distinct()]] | | Makes the results distinct. |
| [[mongodrv-cur-first|first()]] | | Returns the first rows. |
| [[mongodrv-cur-last|last()]] | | Returns the last rows. |
| [[mongodrv-cur-limit|limit()]] | | Restricts the number of rows returned. |
| [[mongodrv-cur-max|max()]] | | Returns the maximum values for the selected rows. |
| [[mongodrv-cur-min|min()]] | | Returns the minumum values for the selected rows. |
| [[mongodrv-cur-orderBy|orderBy()]] | | Sorts the results. |
| [[mongodrv-cur-pretty|pretty()]] | | Formats BSON documents. |
| [[mongodrv-cur-select|select()]] | | Selects fields into a table result. |
| [[mongodrv-cur-sort|sort()]] | | Sorts the results. |
| [[mongodrv-cur-sum|sum()]] | | Returns sums for the selected rows. |
]]]
----
[[Main|home]] | [[MongoDB Driver]]
|