MongoServer Methods |
The MongoServer type exposes the following members.
Name | Description | |
---|---|---|
Connect |
Connects to the server. Normally there is no need to call this method as
the driver will connect to the server automatically when needed.
| |
Connect(TimeSpan) |
Connects to the server. Normally there is no need to call this method as
the driver will connect to the server automatically when needed.
| |
DatabaseExists |
Tests whether a database exists.
| |
Disconnect |
Disconnects from the server. Normally there is no need to call this method so
you should be sure to have a good reason to call it.
| |
DropDatabase |
Drops a database.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
FetchDBRef |
Fetches the document referred to by the DBRef.
| |
FetchDBRefAs(Type, MongoDBRef) |
Fetches the document referred to by the DBRef.
| |
FetchDBRefAsTDocument(MongoDBRef) |
Fetches the document referred to by the DBRef, deserialized as a TDocument.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetAllServers |
Gets an array containing a snapshot of the set of all servers that have been created so far.
| |
GetDatabase(String) |
Gets a MongoDatabase instance representing a database on this server.
| |
GetDatabase(String, MongoDatabaseSettings) |
Gets a MongoDatabase instance representing a database on this server.
| |
GetDatabase(String, WriteConcern) |
Gets a MongoDatabase instance representing a database on this server.
| |
GetDatabaseNames |
Gets the names of the databases on this server.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetServerInstance |
Gets the server instance.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IsDatabaseNameValid |
Checks whether a given database name is valid on this server.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Ping |
Checks whether the server is alive (throws an exception if not). If server is a replica set, pings all members one at a time.
| |
Reconnect |
Reconnects to the server. Normally there is no need to call this method. All connections
are closed and new connections will be opened as needed. Calling
this method frequently will result in connection thrashing.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UnregisterAllServers |
Unregisters all servers from the dictionary used by Create to remember which servers have already been created.
| |
UnregisterServer |
Unregisters a server from the dictionary used by Create to remember which servers have already been created.
| |
WithReadConcern |
Returns a new MongoServer instance with a different read concern setting.
| |
WithReadPreference |
Returns a new MongoServer instance with a different read preference setting.
| |
WithWriteConcern |
Returns a new MongoServer instance with a different write concern setting.
|
Name | Description | |
---|---|---|
ToBson |
Serializes an object to a BSON byte array.
(Defined by BsonExtensionMethods.) | |
ToBsonDocument |
Serializes an object to a BsonDocument.
(Defined by BsonExtensionMethods.) | |
ToJson |
Serializes an object to a JSON string.
(Defined by BsonExtensionMethods.) |