Interface IMongoConnection
Inherited Members
System.IDisposable.Dispose()
Assembly: Mars.Core.dll
Syntax
public interface IMongoConnection : IDisposable
Properties
|
Improve this Doc
View Source
Database
Gets the database configured for this connection.
Declaration
IMongoDatabase Database { get; }
Property Value
Type |
Description |
MongoDB.Driver.IMongoDatabase |
|
Methods
|
Improve this Doc
View Source
DropCollection(String)
Removes the specified collection with the given collectionName
.
Declaration
void DropCollection(string collectionName)
Parameters
Type |
Name |
Description |
System.String |
collectionName |
The collection name |
Exceptions
Type |
Condition |
System.ArgumentException |
Collection name is empty or null |
|
Improve this Doc
View Source
GetCollection<T>(String)
Gets or creates the MongoDB.Driver.IMongoCollection<TDocument> for the specified
collection name
Declaration
IMongoCollection<T> GetCollection<T>(string collection)
Parameters
Type |
Name |
Description |
System.String |
collection |
The collection name |
Returns
Type |
Description |
MongoDB.Driver.IMongoCollection<T> |
Returns the collection with base mongo CRUD interface
|
Type Parameters
Name |
Description |
T |
The inner type representation. |
Exceptions
Type |
Condition |
System.ArgumentException |
Collection name is empty or null |
|
Improve this Doc
View Source
Open()
Opens a new connection to the mongo with the endpoint
specified in options
Declaration
Returns
Type |
Description |
MongoDB.Driver.IClientSession |
|
Extension Methods