সমস্ত ডাটাবেস থেকে সমস্ত সংগ্রহ পেতে, আসুন প্রথমে নিম্নলিখিত ক্যোয়ারীটি ব্যবহার করে সমস্ত ডেটাবেস পাই
> switchDatabaseAdmin = db.getSiblingDB("admin"); admin > allDatabaseName = switchDatabaseAdmin.runCommand({ "listDatabases": 1 }).databases;
এটি নিম্নলিখিত আউটপুট তৈরি করবে
[ { "name" : "admin", "sizeOnDisk" : 495616, "empty" : false }, { "name" : "config", "sizeOnDisk" : 98304, "empty" : false }, { "name" : "local", "sizeOnDisk" : 73728, "empty" : false }, { "name" : "sample", "sizeOnDisk" : 1335296, "empty" : false }, { "name" : "sampleDemo", "sizeOnDisk" : 278528, "empty" : false }, { "name" : "studentSearch", "sizeOnDisk" : 262144, "empty" : false }, { "name" : "test", "sizeOnDisk" : 8724480, "empty" : false } ]
ডাটাবেসগুলি থেকে সমস্ত সংগ্রহের নাম পেতে ক্যোয়ারী নিচে দেওয়া হল
> allDatabaseName.forEach(function(databaseName) ... { ... db = db.getSiblingDB(databaseName.name); ... collectionName = db.getCollectionNames(); ... collectionName.forEach(function(collectionName) ... { ... print(collectionName); ... }); ... });
এটি নিম্নলিখিত আউটপুট তৈরি করবে
clearingItemsInNestedArrayDemo customIdDemo deleteRecordDemo documentExistsOrNotDemo findAllExceptFromOneOrtwoDemo mongoExportDemo startup_log arraySizeErrorDemo basicInformationDemo copyThisCollectionToSampleDatabaseDemo deleteAllRecordsDemo deleteDocuments deleteDocumentsDemo deleteSomeInformation documentWithAParticularFieldValueDemo employee findListOfIdsDemo findSubstring getAllRecordsFromSourceCollectionDemo getElementWithMaxIdDemo internalArraySizeDemo largestDocumentDemo makingStudentInformationClone oppositeAddToSetDemo prettyDemo returnOnlyUniqueValuesDemo selectWhereInDemo sourceCollection studentInformation sumOfValueDemo truncateDemo updateInformation userInformation copyThisCollectionToSampleDatabaseDemo deleteDocuments deleteDocumentsDemo deleteInformation employee internalArraySizeDemo prettyDemo sourceCollection updateInformation userInformation col1 col2 indexingForArrayElementDemo removeObjectFromArrayDemo specifyAKeyDemo useVariableDemo ConvertStringToDateDemo Employee_Information IdUpdateDemo IndexingDemo NotAndDemo ProductsInformation addCurrentDateTimeDemo addFieldDemo addNewFieldToEveryDocument aggregateSumDemo aggregationFrameworkWithOrMatchDemo aggregationSortDemo andOrDemo arrayInnerElementsDemo arrayLengthGreaterThanOne arrayOfArraysDemo avoidDuplicateEntriesDemo caseInsensitiveDemo caseInsesitiveDemo castingDemo changeDataType changeType charactersAllowedDemo charactersDemo checkFieldContainsStringDemo checkFieldExistsOrNotDemo checkSequenceDemo collectionOnDifferentDocumentDemo combinationOfArrayDemo comparingTwoFieldsDemo concatStringAndIntDemo conditionalSumDemo convertStringToNumberDemo copyThisCollectionToSampleDatabaseDemo countDemo countPerformanceDemo createSequenceDemo creatingUniqueIndexDemo dateDemo deleteAllElementsInArrayDemo deleteRecordDemo demo.insertCollection distinctAggregation distinctCountValuesDemo distinctRecordDemo distinctWithMultipleKeysDemo doubleNestedArrayDemo embeddedCollectionDemo employeeInformation equivalentForSelectColumn1Column2Demo fieldIsNullOrNotSetDemo filterArray findAllDuplicateKeyDocumentDemo findAllNonDistinctDemo findByMultipleArrayDemo findDocumentDoNotHaveCertainFields findDocumentNonExistenceFieldDemo findDocumentWithObjectIdDemo findDuplicateByKeyDemo findDuplicateRecordsDemo findMinValueDemo findSpecificValue findValueInArrayWithMultipleCriteriaDemo firstDocumentDemo firstItemInArrayToNewFieldDemo getDistinctListOfSubDocumentFieldDemo getFirstItemDemo getIndexSizeDemo getLastNRecordsDemo getLastXRecordsDemo getNThElementDemo getParticularElementFromArrayDemo getPartuclarElement getSizeDemo getSizeOfArray gettingHighestValueDemo groupByDateDemo hideidDemo identifyLastDocuementDemo incrementValueDemo incrementValueInNestedArrayDemo indexDemo indexOptimizationDemo indexTimeDemo index_Demo indexingDemo insertDemo insertFieldWithCurrentDateDemo insertIfNotExistsDemo insertIntegerDemo insertOneRecordDemo listAllValuesOfCeratinFieldsDemo matchBetweenFieldsDemo mongoExportDemo multipleOrDemo my-collection nestedArrayDemo nestedIndexDemo nestedObjectDemo new_Collection notLikeOpeartorDemo numberofKeysInADocumentDemo objectInAnArrayDemo objectidToStringDemo orConditionDemo orDemo orderDocsDemo paginationDemo performRegex priceStoredAsStringDemo priceStoredDemo queryArrayElementsDemo queryByKeyDemo queryBySubFieldDemo queryForBooleanFieldsDemo queryInSameDocumentsDemo queryToEmbeddedDocument queryingMongoDbCaseInsensitiveDemo regExpOnIntegerDemo regexSearchDemo removeArrayDemo removeArrayElement removeArrayElementByItsIndexDemo removeArrayElements removeDocumentOnBasisOfId removeDuplicateDocumentDemo removeDuplicateDocuments removeElementFromDoublyNestedArrayDemo removeFieldCompletlyDemo removeMultipleDocumentsDemo removeObject removingidElementDemo renameFieldDemo retrieveValueFromAKeyDemo retunFieldInFindDemo returnQueryFromDate reverseRegexDemo s searchArrayDemo searchDocumentDemo searchDocumentWithSpecialCharactersDemo searchMultipleFieldsDemo secondDocumentDemo selectInWhereIdDemo selectMongoDBDocumentsWithSomeCondition selectRecordsHavingKeyDemo selectSingleFieldDemo singleFieldDemo sortDemo sortInnerArrayDemo sortingDemo sourceCollection sqlLikeDemo stringFieldLengthDemo stringToObjectIdDemo test.js translateDefinitionDemo unconditionalUpdatesDemo uniqueIndexOnArrayDemo unprettyJsonDemo unwindOperatorDemo updateDemo updateExactField updateIdDemo updateManyDocumentsDemo updateNestedValueDemo updateObjects updatingEmbeddedDocumentPropertyDemo userStatus