static public void testcommand() { string connectionStr = "mongodb://localhost:27017"; MongoClient _client = new MongoClient(connectionStr); MongoDatabaseBase _database = _client.GetDatabase("music") as MongoDatabaseBase; IMongoCollection <BsonDocument> collection = _database.GetCollection <BsonDocument>("namespaces"); var s = _database.ListCollections().ToList().Count; //var value= collection.Find(new BsonDocument("", "")).First(); //int num = _database.RunCommand(new JsonCommand<int>("{db:'stats'}")); }