Click or drag to resize

MongoServer Methods

The MongoServer type exposes the following members.

Methods
  NameDescription
Public methodConnect
Connects to the server. Normally there is no need to call this method as the driver will connect to the server automatically when needed.
Public methodConnect(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.
Public methodDatabaseExists
Tests whether a database exists.
Public methodDisconnect
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.
Public methodDropDatabase
Drops a database.
Public methodEquals (Inherited from Object.)
Public methodFetchDBRef
Fetches the document referred to by the DBRef.
Public methodFetchDBRefAs(Type, MongoDBRef)
Fetches the document referred to by the DBRef.
Public methodFetchDBRefAsTDocument(MongoDBRef)
Fetches the document referred to by the DBRef, deserialized as a TDocument.
Protected methodFinalize (Inherited from Object.)
Public methodStatic memberGetAllServers
Gets an array containing a snapshot of the set of all servers that have been created so far.
Public methodGetDatabase(String)
Gets a MongoDatabase instance representing a database on this server.
Public methodGetDatabase(String, MongoDatabaseSettings)
Gets a MongoDatabase instance representing a database on this server.
Public methodGetDatabase(String, WriteConcern)
Gets a MongoDatabase instance representing a database on this server.
Public methodGetDatabaseNames
Gets the names of the databases on this server.
Public methodGetHashCode (Inherited from Object.)
Public methodGetServerInstance
Gets the server instance.
Public methodGetType (Inherited from Object.)
Public methodIsDatabaseNameValid
Checks whether a given database name is valid on this server.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodPing
Checks whether the server is alive (throws an exception if not). If server is a replica set, pings all members one at a time.
Public methodReconnect
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.
Public methodToString (Inherited from Object.)
Public methodStatic memberUnregisterAllServers
Unregisters all servers from the dictionary used by Create to remember which servers have already been created.
Public methodStatic memberUnregisterServer
Unregisters a server from the dictionary used by Create to remember which servers have already been created.
Public methodWithReadConcern
Returns a new MongoServer instance with a different read concern setting.
Public methodWithReadPreference
Returns a new MongoServer instance with a different read preference setting.
Public methodWithWriteConcern
Returns a new MongoServer instance with a different write concern setting.
Top
Extension Methods
  NameDescription
Public Extension MethodToBson
Serializes an object to a BSON byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument
Serializes an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson
Serializes an object to a JSON string.
(Defined by BsonExtensionMethods.)
Top
See Also