मोंगो शेल में सभी संग्रहों को सूचीबद्ध करने के लिए, आप getCollectionNames() फ़ंक्शन का उपयोग कर सकते हैं।
वाक्य रचना इस प्रकार है -
db.getCollectionNames();
आप एक अन्य कमांड का उपयोग कर सकते हैं जो कि संग्रह है। वाक्य रचना इस प्रकार है -
show collections;
Mongo में सभी संग्रहों को सूचीबद्ध करने के लिए, उपरोक्त दो कार्यों का उपयोग करें। क्वेरी इस प्रकार है -
> db.getCollectionNames();
निम्न आउटपुट है -
[ "ConvertStringToDateDemo", "IdUpdateDemo", "ProductsInformation", "addFieldDemo", "addNewFieldToEveryDocument", "arrayInnerElementsDemo", "arrayLengthGreaterThanOne", "arrayOfArraysDemo", "caseInsensitiveDemo", "changeDataType", "changeType", "charactersAllowedDemo", "charactersDemo", "checkFieldContainsStringDemo", "checkSequenceDemo", "combinationOfArrayDemo", "conditionalSumDemo", "convertStringToNumberDemo", "copyThisCollectionToSampleDatabaseDemo", "countDemo", "createSequenceDemo", "distinctCountValuesDemo", "distinctRecordDemo", "distinctWithMultipleKeysDemo", "employeeInformation", "filterArray", "findAllDuplicateKeyDocumentDemo", "findByMultipleArrayDemo", "findDuplicateByKeyDemo", "findDuplicateRecordsDemo", "findSpecificValue", "findValueInArrayWithMultipleCriteriaDemo", "getLastNRecordsDemo", "getParticularElementFromArrayDemo", "getPartuclarElement", "getSizeOfArray", "groupByDateDemo", "incrementValueInNestedArrayDemo", "insertIfNotExistsDemo", "nestedArrayDemo", "notLikeOpeartorDemo", "regExpOnIntegerDemo", "removeArrayDemo", "removeArrayElement", "removeArrayElements", "removeDuplicateDocumentDemo", "removeElementFromDoublyNestedArrayDemo", "removeFieldCompletlyDemo", "removeObject", "renameFieldDemo", "reverseRegexDemo", "searchArrayDemo", "selectSingleFieldDemo", "singleFieldDemo", "sortDemo", "sortInnerArrayDemo", "sourceCollection", "stringFieldLengthDemo", "test.js", "uniqueIndexOnArrayDemo", "unwindOperatorDemo", "updateExactField", "updateIdDemo", "updateObjects" ]
मोंगो से सभी संग्रह प्रदर्शित करने के लिए यहां दूसरी क्वेरी है। क्वेरी इस प्रकार है -
> show collections;
निम्न आउटपुट है -
ConvertStringToDateDemo IdUpdateDemo ProductsInformation addFieldDemo addNewFieldToEveryDocument arrayInnerElementsDemo arrayLengthGreaterThanOne arrayOfArraysDemo caseInsensitiveDemo changeDataType changeType charactersAllowedDemo charactersDemo checkFieldContainsStringDemo checkSequenceDemo combinationOfArrayDemo conditionalSumDemo convertStringToNumberDemo copyThisCollectionToSampleDatabaseDemo countDemo createSequenceDemo distinctCountValuesDemo distinctRecordDemo distinctWithMultipleKeysDemo employeeInformation filterArray findAllDuplicateKeyDocumentDemo findByMultipleArrayDemo findDuplicateByKeyDemo findDuplicateRecordsDemo findSpecificValue findValueInArrayWithMultipleCriteriaDemo getLastNRecordsDemo getParticularElementFromArrayDemo getPartuclarElement getSizeOfArray groupByDateDemo incrementValueInNestedArrayDemo insertIfNotExistsDemo nestedArrayDemo notLikeOpeartorDemo regExpOnIntegerDemo removeArrayDemo removeArrayElement removeArrayElements removeDuplicateDocumentDemo removeElementFromDoublyNestedArrayDemo removeFieldCompletlyDemo removeObject renameFieldDemo reverseRegexDemo searchArrayDemo selectSingleFieldDemo singleFieldDemo sortDemo sortInnerArrayDemo sourceCollection stringFieldLengthDemo test.js uniqueIndexOnArrayDemo unwindOperatorDemo updateExactField updateIdDemo updateObjects