MongoDB Manual / 参考 / mongosh 方法 / Databases 定义 db.getCollectionInfos(filter, nameOnly, authorizedCollections) 返回包含集合或视图信息(例如针对当前数据库的名称和选项)的文档的数组。结果取决于用户权限。有关详细信息,请参阅所需的访问权限。
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本 必需的访问权限 db.getCollectionNames()相当于: db.runCommand( { listCollections:1.0, authorizedCollections:true, nameOnly:true } ) 对于具有所需访问权限(授予对数据库执行listCollections操作的权限)的用户,该方法列出了数据库所有集合的名称。
config.setMaxConnectionCount(1);finalMongoClient mongo = MongoFactory.createClient(config);finalMongoDatabase db = mongo.getDatabase("test");finalMongoCollection collection = db.getCollection("test");// Make sure the collection is created and empty.db.createCollection("test", BuilderFactory.start...
return Collections.singletonList( (InputSplit) new MongoInputSplit(getConfiguration())); } 代码示例来源:origin: org.mongodb/mongo-hadoop-core public static DBCollection getCollectionWithAuth(final MongoClientURI uri, final MongoClientURI authURI) { //Make sure auth uri is valid and actually has ...
* Java : Get collection from MongoDB * */publicclassGetCollectionApp{publicstaticvoidmain(String[] args){try{Mongomongo=newMongo("localhost",27017);DBdb=mongo.getDB("yourdb");// get list of collectionsSet<String> collections = db.getCollectionNames();for(String collectionName : collections)...
Gets the MongoDB collection under an existing Azure Cosmos DB database account. Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName} Operation Id: MongoDB...
withTags public MongoDBCollectionGetResultsInner withTags(Map tags) Overrides: MongoDBCollectionGetResultsInner.withTags(Map<String,String> tags) Parameters: tags Applies to Azure SDK for Java Latest在GitHub 上與我們協作 可以在 GitHub 上找到此内容的源,还可以在其中创建和查看问题和...
.CosmosDB.Fluent.Models.MongoDBCollectionGetResultsInner>> GetMongoDBCollectionWithHttpMessagesAsync (string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>...
withTags public MongoDBCollectionGetResultsInner withTags(Map tags) Overrides: MongoDBCollectionGetResultsInner.withTags(Map<String,String> tags) Parameters: tags Applies to Azure SDK for Java LatestCollabora con noi su GitHub L'origine di questo contenuto è disponibile in GitHub, in c...
Similarly, we can get the size of a database in the following examples. Get Statistics in KB: > db.stats(1024) OUTPUT: { "db" : "test", "collections" : 5, "views" : 0, "objects" : 15, "avgObjSize" : 99, "dataSize" : 1.4501953125, "storageSize" : 132, "indexes" : 5,...