Interface IMongoConnection
Assembly: Mars.Core.dll
Syntax
public interface IMongoConnection : IDisposable
Properties
Database
Gets the database configured for this connection.
Declaration
IMongoDatabase Database { get; }
Property Value
Type |
Description |
IMongoDatabase |
|
Methods
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 |
GetCollection<T>(String)
Gets or creates the 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 |
IMongoCollection<T> |
Returns the collection with base mongo CRUD interface
|
Type Parameters
Name |
Description |
T |
The inner type representation. |
Open()
Opens a new connection to the mongo with the endpoint
specified in options
Declaration
Returns
Type |
Description |
IClientSession |
|