C# Class MongoUtility.Command.DataBaseCommand

DataBase Command
显示文件 Open project: magicdict/MongoCola Class Usage Examples

Public Properties

Property Type Description
CompactCommand MongoCommand
RepairDatabaseCommand MongoCommand
ReplSetGetStatusCommand MongoCommand
ServerStatusCommand MongoCommand

Public Methods

Method Description
AddShardToZone ( MongoServer routeSvr, string shardName, string zone ) : CommandResult

AddShardToZone

AddSharding ( MongoServer routeSvr, string replicaSetName, List lstAddress, string name, decimal maxSize ) : CommandResult

增加数据分片

注意:有个命令可能只能用在mongos上面

Aggregate ( BsonArray aggregateDoc, string collectionName ) : CommandResult

执行聚合

Aggregate ( BsonArray aggregateDoc, string databaseName, string collectionName ) : CommandResult

执行聚合(指定路劲)

Count ( BsonDocument QueryDoc, string databaseName, string collectionName ) : CommandResult

执行Count(指定路劲)

EnableSharding ( MongoServer routeSvr, string shardingDb ) : CommandResult

数据库分片

InitReplicaSet ( ) : CommandResult

初始化副本(Mongo Shell)

InitReplicaSet ( string replicaSetName, string hostList, MongoConnectionConfig>.Dictionary configs ) : CommandResult

初始化副本(数据库版本 - 废止)

ReconfigReplsetServer ( MongoServer primarySvr, BsonDocument config, System.Boolean force = false ) : CommandResult

重新启动

这个命令C#无法正确执行

RemoveSharding ( MongoServer routeSvr, string shardName ) : CommandResult

移除Shard

ShardCollection ( MongoServer routeSvr, string sharingCollection, BsonDocument shardingKey ) : CommandResult

数据集分片

convertToCapped ( string collectionName, long size, MongoDatabase db ) : CommandResult

convertToCapped

createRole ( MongoDatabase mongoDb, Role role ) : CommandResult

添加自定义角色

createUser ( MongoUserEx user, MongoDatabase db ) : CommandResult

新建用户

updateUser ( MongoUserEx user, MongoDatabase db ) : CommandResult

修改用户(完全替换)

updateZoneKeyRange ( MongoServer routeSvr, string nameSpace, string FieldName, BsonValue min, BsonValue max, string zone ) : CommandResult

AddTagRange

Method Details

AddShardToZone() public static method

AddShardToZone
public static AddShardToZone ( MongoServer routeSvr, string shardName, string zone ) : CommandResult
routeSvr MongoServer 服务器
shardName string Shard名称
zone string
return MongoDB.Driver.CommandResult

AddSharding() public static method

增加数据分片
注意:有个命令可能只能用在mongos上面
public static AddSharding ( MongoServer routeSvr, string replicaSetName, List lstAddress, string name, decimal maxSize ) : CommandResult
routeSvr MongoServer
replicaSetName string
lstAddress List
name string
maxSize decimal
return MongoDB.Driver.CommandResult

Aggregate() public static method

执行聚合
public static Aggregate ( BsonArray aggregateDoc, string collectionName ) : CommandResult
aggregateDoc BsonArray
collectionName string
return MongoDB.Driver.CommandResult

Aggregate() public static method

执行聚合(指定路劲)
public static Aggregate ( BsonArray aggregateDoc, string databaseName, string collectionName ) : CommandResult
aggregateDoc BsonArray
databaseName string
collectionName string
return MongoDB.Driver.CommandResult

Count() public static method

执行Count(指定路劲)
public static Count ( BsonDocument QueryDoc, string databaseName, string collectionName ) : CommandResult
QueryDoc BsonDocument
databaseName string
collectionName string
return MongoDB.Driver.CommandResult

EnableSharding() public static method

数据库分片
public static EnableSharding ( MongoServer routeSvr, string shardingDb ) : CommandResult
routeSvr MongoServer
shardingDb string
return MongoDB.Driver.CommandResult

InitReplicaSet() public static method

初始化副本(Mongo Shell)
public static InitReplicaSet ( ) : CommandResult
return MongoDB.Driver.CommandResult

InitReplicaSet() public static method

初始化副本(数据库版本 - 废止)
public static InitReplicaSet ( string replicaSetName, string hostList, MongoConnectionConfig>.Dictionary configs ) : CommandResult
replicaSetName string 副本名称
hostList string 从属服务器列表
configs MongoConnectionConfig>.Dictionary
return MongoDB.Driver.CommandResult

ReconfigReplsetServer() public static method

重新启动
这个命令C#无法正确执行
public static ReconfigReplsetServer ( MongoServer primarySvr, BsonDocument config, System.Boolean force = false ) : CommandResult
primarySvr MongoServer 副本组主服务器
config BsonDocument 服务器信息
force System.Boolean
return MongoDB.Driver.CommandResult

RemoveSharding() public static method

移除Shard
public static RemoveSharding ( MongoServer routeSvr, string shardName ) : CommandResult
routeSvr MongoServer
shardName string Shard名称
return MongoDB.Driver.CommandResult

ShardCollection() public static method

数据集分片
public static ShardCollection ( MongoServer routeSvr, string sharingCollection, BsonDocument shardingKey ) : CommandResult
routeSvr MongoServer
sharingCollection string
shardingKey BsonDocument
return MongoDB.Driver.CommandResult

convertToCapped() public static method

convertToCapped
public static convertToCapped ( string collectionName, long size, MongoDatabase db ) : CommandResult
collectionName string
size long
db MongoDatabase
return MongoDB.Driver.CommandResult

createRole() public static method

添加自定义角色
public static createRole ( MongoDatabase mongoDb, Role role ) : CommandResult
mongoDb MongoDatabase
role MongoUtility.Security.Role
return MongoDB.Driver.CommandResult

createUser() public static method

新建用户
public static createUser ( MongoUserEx user, MongoDatabase db ) : CommandResult
user MongoUserEx
db MongoDatabase
return CommandResult

updateUser() public static method

修改用户(完全替换)
public static updateUser ( MongoUserEx user, MongoDatabase db ) : CommandResult
user MongoUserEx
db MongoDatabase
return CommandResult

updateZoneKeyRange() public static method

AddTagRange
public static updateZoneKeyRange ( MongoServer routeSvr, string nameSpace, string FieldName, BsonValue min, BsonValue max, string zone ) : CommandResult
routeSvr MongoServer 路由服务器
nameSpace string 名字空间
FieldName string
min BsonValue 最小值
max BsonValue 最大值
zone string
return CommandResult

Property Details

CompactCommand public_oe static_oe property

Compact
public static MongoCommand CompactCommand
return MongoCommand

RepairDatabaseCommand public_oe static_oe property

修复数据库
public static MongoCommand RepairDatabaseCommand
return MongoCommand

ReplSetGetStatusCommand public_oe static_oe property

副本状态 http://www.mongodb.org/display/DOCS/Replica+Set+Commands
public static MongoCommand ReplSetGetStatusCommand
return MongoCommand

ServerStatusCommand public_oe static_oe property

服务器状态 [OLD]http://www.mongodb.org/display/DOCS/serverStatus+Command [NEW]https://docs.mongodb.com/manual/reference/command/serverStatus/
public static MongoCommand ServerStatusCommand
return MongoCommand