C# Class MongoUtility.Command.Operater

Exibir arquivo Open project: magicdict/MongoCola Class Usage Examples

Public Methods

Method Description
Compact ( ) : void

压缩

CopyCollection ( MongoDatabase fromDb, MongoDatabase toDb, string collectionName, bool isIndex ) : bool

复制表

CreateCollection ( string strObjTag, string collectionName, MongoDatabase mongoDb ) : bool

Create Collection

CreateCollectionWithOptions ( string strObjTag, string collectionName, CollectionOptionsBuilder option, MongoDatabase mongoDb ) : bool

带有参数的CreateOption

CreateDataBaseWithInitCollection ( string dbName, string CollectionName ) : string

新建数据库 数据库必须有一个数据集,如果没有数据集的话,则数据库会被回收掉

CreateIndex ( IndexOption KeyOptions, string &strMessageTitle, string &strMessageContent ) : bool

CreateMongoIndex ( IndexOption IdxOpt, IndexOptionsBuilder option, MongoCollection currentCollection, string &errorMessage ) : bool

添加索引

CreateNewJavascript ( string jsName, string jsCode ) : string

插入JS到系统JS库

DelJavascript ( string jsName ) : string

Delete Javascript Collection Document

DrapCollection ( string strCollectionName ) : bool

删除数据集

DropDatabase ( string strObjTag, string dbName ) : string

数据库操作

DropDocument ( MongoCollection mongoCol, string objectId ) : string

删除单条数据

DropJsDocument ( MongoCollection mongoCol, object strKey ) : string

删除js数据

DropMongoIndex ( string indexName, MongoCollection mongoCol ) : bool

删除索引[KEY_ID]以外

GetShardInfo ( MongoServer server, string key ) : string>.Dictionary

获得Shard情报

InitReplicaSet ( string replSetName, string &strMessage ) : bool

初始化副本

InsertEmptyDocument ( MongoCollection mongoCol, bool safeMode ) : BsonValue

插入空文档

IsDatabaseNameValid ( string strDbName, string &errMessage ) : bool

是否为合法的数据库名称

IsSystemCollection ( ) : bool
IsSystemCollection ( MongoCollection mongoCol ) : bool

是否为系统数据集[无法删除]

IsSystemCollection ( string mongoDbName, string mongoColName ) : bool

是否为系统数据集[无法删除]

IsSystemDataBase ( string dataBaseName ) : bool

是否为系统数据库[无法删除]

LoadJavascript ( string jsName, MongoCollection jsCol ) : string

获得JS代码

ReIndex ( ) : void

ReIndex

RefreshConnectionConfig ( MongoConnectionConfig newConfig ) : void

刷新配置文件副本状态

RenameCollection ( string strOldCollectionName, string strNewCollectionName ) : bool

重命名数据集

RepairDb ( ) : void

修复和压缩数据库

SaveEditorJavascript ( string jsName, string jsCode, MongoCollection jsCol ) : string

Save Edited Javascript

Validate ( bool isFull ) : BsonDocument

验证

Method Details

Compact() public static method

压缩
public static Compact ( ) : void
return void

CopyCollection() public static method

复制表
public static CopyCollection ( MongoDatabase fromDb, MongoDatabase toDb, string collectionName, bool isIndex ) : bool
fromDb MongoDatabase 数据来源
toDb MongoDatabase 数据去向
collectionName string 表名
isIndex bool 是否连同索引一起复制
return bool

CreateCollection() public static method

Create Collection
public static CreateCollection ( string strObjTag, string collectionName, MongoDatabase mongoDb ) : bool
strObjTag string
collectionName string
mongoDb MongoDatabase
return bool

CreateCollectionWithOptions() public static method

带有参数的CreateOption
public static CreateCollectionWithOptions ( string strObjTag, string collectionName, CollectionOptionsBuilder option, MongoDatabase mongoDb ) : bool
strObjTag string
collectionName string
option MongoDB.Driver.Builders.CollectionOptionsBuilder
mongoDb MongoDatabase
return bool

CreateDataBaseWithInitCollection() public static method

新建数据库 数据库必须有一个数据集,如果没有数据集的话,则数据库会被回收掉
public static CreateDataBaseWithInitCollection ( string dbName, string CollectionName ) : string
dbName string
CollectionName string
return string

CreateIndex() public static method

public static CreateIndex ( IndexOption KeyOptions, string &strMessageTitle, string &strMessageContent ) : bool
KeyOptions IndexOption
strMessageTitle string
strMessageContent string
return bool

CreateMongoIndex() public static method

添加索引
public static CreateMongoIndex ( IndexOption IdxOpt, IndexOptionsBuilder option, MongoCollection currentCollection, string &errorMessage ) : bool
IdxOpt IndexOption
option MongoDB.Driver.Builders.IndexOptionsBuilder
currentCollection MongoCollection
errorMessage string
return bool

CreateNewJavascript() public static method

插入JS到系统JS库
public static CreateNewJavascript ( string jsName, string jsCode ) : string
jsName string
jsCode string
return string

DelJavascript() public static method

Delete Javascript Collection Document
public static DelJavascript ( string jsName ) : string
jsName string
return string

DrapCollection() public static method

删除数据集
public static DrapCollection ( string strCollectionName ) : bool
strCollectionName string
return bool

DropDatabase() public static method

数据库操作
public static DropDatabase ( string strObjTag, string dbName ) : string
strObjTag string
dbName string
return string

DropDocument() public static method

删除单条数据
public static DropDocument ( MongoCollection mongoCol, string objectId ) : string
mongoCol MongoCollection 表对象
objectId string ObjectId
return string

DropJsDocument() public static method

删除js数据
public static DropJsDocument ( MongoCollection mongoCol, object strKey ) : string
mongoCol MongoCollection
strKey object
return string

DropMongoIndex() public static method

删除索引[KEY_ID]以外
public static DropMongoIndex ( string indexName, MongoCollection mongoCol ) : bool
indexName string
mongoCol MongoCollection
return bool

GetShardInfo() public static method

获得Shard情报
public static GetShardInfo ( MongoServer server, string key ) : string>.Dictionary
server MongoServer
key string
return string>.Dictionary

InitReplicaSet() public static method

初始化副本
public static InitReplicaSet ( string replSetName, string &strMessage ) : bool
replSetName string
strMessage string
return bool

InsertEmptyDocument() public static method

插入空文档
public static InsertEmptyDocument ( MongoCollection mongoCol, bool safeMode ) : BsonValue
mongoCol MongoCollection
safeMode bool
return BsonValue

IsDatabaseNameValid() public static method

是否为合法的数据库名称
public static IsDatabaseNameValid ( string strDbName, string &errMessage ) : bool
strDbName string
errMessage string
return bool

IsSystemCollection() public static method

public static IsSystemCollection ( ) : bool
return bool

IsSystemCollection() public static method

是否为系统数据集[无法删除]
public static IsSystemCollection ( MongoCollection mongoCol ) : bool
mongoCol MongoCollection
return bool

IsSystemCollection() public static method

是否为系统数据集[无法删除]
public static IsSystemCollection ( string mongoDbName, string mongoColName ) : bool
mongoDbName string
mongoColName string
return bool

IsSystemDataBase() public static method

是否为系统数据库[无法删除]
public static IsSystemDataBase ( string dataBaseName ) : bool
dataBaseName string
return bool

LoadJavascript() public static method

获得JS代码
public static LoadJavascript ( string jsName, MongoCollection jsCol ) : string
jsName string
jsCol MongoCollection
return string

ReIndex() public static method

ReIndex
public static ReIndex ( ) : void
return void

RefreshConnectionConfig() public static method

刷新配置文件副本状态
public static RefreshConnectionConfig ( MongoConnectionConfig newConfig ) : void
newConfig MongoUtility.Core.MongoConnectionConfig
return void

RenameCollection() public static method

重命名数据集
public static RenameCollection ( string strOldCollectionName, string strNewCollectionName ) : bool
strOldCollectionName string
strNewCollectionName string
return bool

RepairDb() public static method

修复和压缩数据库
public static RepairDb ( ) : void
return void

SaveEditorJavascript() public static method

Save Edited Javascript
public static SaveEditorJavascript ( string jsName, string jsCode, MongoCollection jsCol ) : string
jsName string
jsCode string
jsCol MongoCollection
return string

Validate() public static method

验证
public static Validate ( bool isFull ) : BsonDocument
isFull bool
return BsonDocument