MongoServer Class |
Namespace: MongoDB.Driver
The MongoServer type exposes the following members.
Name | Description | |
---|---|---|
MongoServer |
Creates a new instance of MongoServer. Normally you will use one of the Create methods instead
of the constructor to create instances of this class.
|
Name | Description | |
---|---|---|
Arbiters |
Gets the arbiter instances.
| |
BuildInfo |
Gets the build info of the server.
| |
Instance |
Gets the one and only instance for this server.
| |
Instances |
Gets the instances for this server.
| |
ItemString | Obsolete.
Gets a MongoDatabase instance representing a database on this server.
| |
ItemString, WriteConcern | Obsolete.
Gets a MongoDatabase instance representing a database on this server.
| |
MaxServerCount |
Gets or sets the maximum number of instances of MongoServer that will be allowed to be created.
| |
Passives | Obsolete.
Gets the passive instances.
| |
Primary |
Gets the primary instance (null if there is no primary).
| |
ReplicaSetName |
Gets the name of the replica set (null if not connected to a replica set).
| |
Secondaries |
Gets the secondary instances.
| |
SequentialId |
Gets the unique sequential Id for this server.
| |
ServerCount |
Gets the number of instances of MongoServer that have been created.
| |
Settings |
Gets the settings for this server.
| |
State |
Gets the current state of this server (as of the last operation, not updated until another operation is performed).
|
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.
|
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.) |