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
Determines whether the specified object is equal to the current object.
(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
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(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
Serves as the default hash function.
(Inherited from Object.)
Public methodGetServerInstance
Gets the server instance.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsDatabaseNameValid
Checks whether a given database name is valid on this server.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(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
Returns a string that represents the current object.
(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