Beispiel #1
0
        public IList <string> ListMongoCollection(string datasourceCode)
        {
            DmeDataSource dmeDataSource = IsMongodbAndReturn(datasourceCode);
            MongodbHost   host          = JsonConvert.DeserializeObject <MongodbHost>(dmeDataSource.Connection);

            if (string.IsNullOrEmpty(host.DataBase))
            {
                throw new BusinessException((int)EnumSystemStatusCode.DME_FAIL, "mongodb的DataBase不能为空");
            }
            return(MongodbManager <object> .ListCollections(host.ConnectionString, host.DataBase));
        }
Beispiel #2
0
        public IList <string> ListMongoCollection(string host, int port, string dataBase)
        {
            string connectionString = $"mongodb://{host}:{port}";

            return(MongodbManager <object> .ListCollections(connectionString, dataBase));
        }