C# Class CSMongo.Commands.MongoDatabaseCommands

Collection of database related commands
Show file Open project: hugoware/CSMongo

Public Methods

Method Description
Authenticate ( MongoDatabase database, string username, string password ) : MethodResult

Handles logging into the specified database

Clone ( MongoDatabase database, string host ) : MethodResult

Clones the current database from the provided host to this server

CollectionCount ( MongoDatabase database, string collection ) : CollectionCountResult

Returns the count of records from the specified collection

CollectionCount ( MongoDatabase database, string collection, BsonDocument query ) : CollectionCountResult

Returns the count of records from the specified collection that meet the criteria for the query

CollectionCount ( MongoDatabase database, string collection, object query ) : CollectionCountResult

Returns the count of records from the specified collection that meet the criteria for the query

CopyDatabase ( MongoDatabase database, string from, string to, string host, int port, string username, string password ) : MethodResult

Copies a database from one location to another

DeleteAllCollectionIndexes ( MongoDatabase database, string collection ) : DeleteCollectionIndexResult

Removes all indexes from the provided collection

DeleteCollectionIndex ( MongoDatabase database, string collection, string index ) : DeleteCollectionIndexResult

Removes the index for key in the provided collection

DropCollection ( MongoDatabase database, string collection ) : DropCollectionResult

Removes a collection entirely from the database

DropDatabase ( MongoDatabase database ) : MethodResult

Deletes a database from the server

FSync ( MongoDatabase database, bool async ) : FSyncResult

Performs the FSync command against the database

ForceError ( MongoDatabase database ) : ForceErrorResult

Forces an error message on the server

GetAssertInfo ( MongoDatabase database ) : MethodResult

Returns assert info for the database ??

GetBuildInfo ( MongoDatabase database ) : BuildInfoResult

Returns build info for the server

GetCollectionDistinct ( MongoDatabase database, string collection, string key ) : CollectionDistinctResult

Gets the distinct values for the collection and key provided

GetCollectionStats ( MongoDatabase database, string collection ) : CollectionStatsResult

Returns details about the provided collection

GetLastError ( MongoDatabase database ) : GetLastErrorResult

Gets the most recent error from the database

GetNonce ( MongoDatabase database ) : GetNonceResult

Loads the 'nonce' value for password hashing

GetOpLogging ( MongoDatabase database ) : MethodResult

Returns OpLogging information for the server

GetOpTime ( MongoDatabase database ) : GetOpTimeResult

Returns OpTime for the provided database

GetPreviousError ( MongoDatabase database ) : GetPreviousErrorResult

Returns information about previous errors on the server

GetServerStatus ( MongoDatabase database ) : MethodResult

Returns uptime, lock and memory info for the database

HashPassword ( string username, string password, string nonce ) : string

Handles preparing a password to send to the database

KillCursors ( MongoDatabase database, IEnumerable cursors ) : void

Sends the request to kill existing cursors

KillCursors ( MongoDatabase database, IEnumerable cursors ) : void

Sends the request to kill existing cursors

ListDatabases ( MongoDatabase database ) : ListDatabasesResult

Returns a list of all available databases

LogOut ( MongoDatabase database ) : void

Performs a manual log our for a connection

RepairDatabase ( MongoDatabase database, bool preserveClonedOnFailure, bool backupOriginal ) : MethodResult

Attempts to repair the current database

ResetErrors ( MongoDatabase database ) : MethodResult

Causes the Mongo server to shutdown - No response is expected

RunCommand ( MongoDatabase database, BsonObject parameters ) : CommandResponse

Executes a command against the database using the provided information

RunCommand ( MongoDatabase database, BsonObject parameters, bool expectResponse ) : CommandResponse

Executes a command against the database using the provided information

RunCommand ( MongoDatabase database, object parameters ) : CommandResponse

Executes a command against the database using the provided information

RunCommand ( MongoDatabase database, object parameters, bool expectResponse ) : CommandResponse

Executes a command against the database using the provided information

SetProfileLevel ( MongoDatabase database, int level ) : ProfileResult

Sets and returns the previous profiling level

SetQueryTraceLevel ( MongoDatabase database, int level ) : MethodResult

Sets the level for the Query Trace in the database

Shutdown ( MongoDatabase database ) : void

Causes the Mongo server to shutdown - No response is expected

Private Methods

Method Description
_HashString ( string value ) : string

Method Details

Authenticate() public static method

Handles logging into the specified database
public static Authenticate ( MongoDatabase database, string username, string password ) : MethodResult
database MongoDatabase
username string
password string
return CSMongo.Results.MethodResult

Clone() public static method

Clones the current database from the provided host to this server
public static Clone ( MongoDatabase database, string host ) : MethodResult
database MongoDatabase
host string
return CSMongo.Results.MethodResult

CollectionCount() public static method

Returns the count of records from the specified collection
public static CollectionCount ( MongoDatabase database, string collection ) : CollectionCountResult
database MongoDatabase
collection string
return CSMongo.Results.CollectionCountResult

CollectionCount() public static method

Returns the count of records from the specified collection that meet the criteria for the query
public static CollectionCount ( MongoDatabase database, string collection, BsonDocument query ) : CollectionCountResult
database MongoDatabase
collection string
query CSMongo.Bson.BsonDocument
return CSMongo.Results.CollectionCountResult

CollectionCount() public static method

Returns the count of records from the specified collection that meet the criteria for the query
public static CollectionCount ( MongoDatabase database, string collection, object query ) : CollectionCountResult
database MongoDatabase
collection string
query object
return CSMongo.Results.CollectionCountResult

CopyDatabase() public static method

Copies a database from one location to another
public static CopyDatabase ( MongoDatabase database, string from, string to, string host, int port, string username, string password ) : MethodResult
database MongoDatabase
from string
to string
host string
port int
username string
password string
return CSMongo.Results.MethodResult

DeleteAllCollectionIndexes() public static method

Removes all indexes from the provided collection
public static DeleteAllCollectionIndexes ( MongoDatabase database, string collection ) : DeleteCollectionIndexResult
database MongoDatabase
collection string
return CSMongo.Results.DeleteCollectionIndexResult

DeleteCollectionIndex() public static method

Removes the index for key in the provided collection
public static DeleteCollectionIndex ( MongoDatabase database, string collection, string index ) : DeleteCollectionIndexResult
database MongoDatabase
collection string
index string
return CSMongo.Results.DeleteCollectionIndexResult

DropCollection() public static method

Removes a collection entirely from the database
public static DropCollection ( MongoDatabase database, string collection ) : DropCollectionResult
database MongoDatabase
collection string
return CSMongo.Results.DropCollectionResult

DropDatabase() public static method

Deletes a database from the server
public static DropDatabase ( MongoDatabase database ) : MethodResult
database MongoDatabase
return CSMongo.Results.MethodResult

FSync() public static method

Performs the FSync command against the database
public static FSync ( MongoDatabase database, bool async ) : FSyncResult
database MongoDatabase
async bool
return CSMongo.Results.FSyncResult

ForceError() public static method

Forces an error message on the server
public static ForceError ( MongoDatabase database ) : ForceErrorResult
database MongoDatabase
return CSMongo.Results.ForceErrorResult

GetAssertInfo() public static method

Returns assert info for the database ??
public static GetAssertInfo ( MongoDatabase database ) : MethodResult
database MongoDatabase
return CSMongo.Results.MethodResult

GetBuildInfo() public static method

Returns build info for the server
public static GetBuildInfo ( MongoDatabase database ) : BuildInfoResult
database MongoDatabase
return CSMongo.Results.BuildInfoResult

GetCollectionDistinct() public static method

Gets the distinct values for the collection and key provided
public static GetCollectionDistinct ( MongoDatabase database, string collection, string key ) : CollectionDistinctResult
database MongoDatabase
collection string
key string
return CSMongo.Results.CollectionDistinctResult

GetCollectionStats() public static method

Returns details about the provided collection
public static GetCollectionStats ( MongoDatabase database, string collection ) : CollectionStatsResult
database MongoDatabase
collection string
return CSMongo.Results.CollectionStatsResult

GetLastError() public static method

Gets the most recent error from the database
public static GetLastError ( MongoDatabase database ) : GetLastErrorResult
database MongoDatabase
return GetLastErrorResult

GetNonce() public static method

Loads the 'nonce' value for password hashing
public static GetNonce ( MongoDatabase database ) : GetNonceResult
database MongoDatabase
return CSMongo.Results.GetNonceResult

GetOpLogging() public static method

Returns OpLogging information for the server
public static GetOpLogging ( MongoDatabase database ) : MethodResult
database MongoDatabase
return CSMongo.Results.MethodResult

GetOpTime() public static method

Returns OpTime for the provided database
public static GetOpTime ( MongoDatabase database ) : GetOpTimeResult
database MongoDatabase
return CSMongo.Results.GetOpTimeResult

GetPreviousError() public static method

Returns information about previous errors on the server
public static GetPreviousError ( MongoDatabase database ) : GetPreviousErrorResult
database MongoDatabase
return CSMongo.Results.GetPreviousErrorResult

GetServerStatus() public static method

Returns uptime, lock and memory info for the database
public static GetServerStatus ( MongoDatabase database ) : MethodResult
database MongoDatabase
return CSMongo.Results.MethodResult

HashPassword() public static method

Handles preparing a password to send to the database
public static HashPassword ( string username, string password, string nonce ) : string
username string
password string
nonce string
return string

KillCursors() public static method

Sends the request to kill existing cursors
public static KillCursors ( MongoDatabase database, IEnumerable cursors ) : void
database MongoDatabase
cursors IEnumerable
return void

KillCursors() public static method

Sends the request to kill existing cursors
public static KillCursors ( MongoDatabase database, IEnumerable cursors ) : void
database MongoDatabase
cursors IEnumerable
return void

ListDatabases() public static method

Returns a list of all available databases
public static ListDatabases ( MongoDatabase database ) : ListDatabasesResult
database MongoDatabase
return ListDatabasesResult

LogOut() public static method

Performs a manual log our for a connection
public static LogOut ( MongoDatabase database ) : void
database MongoDatabase
return void

RepairDatabase() public static method

Attempts to repair the current database
public static RepairDatabase ( MongoDatabase database, bool preserveClonedOnFailure, bool backupOriginal ) : MethodResult
database MongoDatabase
preserveClonedOnFailure bool
backupOriginal bool
return CSMongo.Results.MethodResult

ResetErrors() public static method

Causes the Mongo server to shutdown - No response is expected
public static ResetErrors ( MongoDatabase database ) : MethodResult
database MongoDatabase
return CSMongo.Results.MethodResult

RunCommand() public static method

Executes a command against the database using the provided information
public static RunCommand ( MongoDatabase database, BsonObject parameters ) : CommandResponse
database MongoDatabase
parameters BsonObject
return CSMongo.Responses.CommandResponse

RunCommand() public static method

Executes a command against the database using the provided information
public static RunCommand ( MongoDatabase database, BsonObject parameters, bool expectResponse ) : CommandResponse
database MongoDatabase
parameters BsonObject
expectResponse bool
return CSMongo.Responses.CommandResponse

RunCommand() public static method

Executes a command against the database using the provided information
public static RunCommand ( MongoDatabase database, object parameters ) : CommandResponse
database MongoDatabase
parameters object
return CSMongo.Responses.CommandResponse

RunCommand() public static method

Executes a command against the database using the provided information
public static RunCommand ( MongoDatabase database, object parameters, bool expectResponse ) : CommandResponse
database MongoDatabase
parameters object
expectResponse bool
return CSMongo.Responses.CommandResponse

SetProfileLevel() public static method

Sets and returns the previous profiling level
public static SetProfileLevel ( MongoDatabase database, int level ) : ProfileResult
database MongoDatabase
level int
return CSMongo.Results.ProfileResult

SetQueryTraceLevel() public static method

Sets the level for the Query Trace in the database
public static SetQueryTraceLevel ( MongoDatabase database, int level ) : MethodResult
database MongoDatabase
level int
return CSMongo.Results.MethodResult

Shutdown() public static method

Causes the Mongo server to shutdown - No response is expected
public static Shutdown ( MongoDatabase database ) : void
database MongoDatabase
return void