mongodb 查找数据库中所有以 "xxxx" 开头的集合

 

 

use yourDatabaseName  // 切换到你的数据库名称
db.getCollectionNames().forEach(function(collectionName) {
  if (collectionName.startsWith("xxxx")) {
    print(collectionName);
  }
});

 

posted @ 2023-11-01 12:29  AngDH  阅读(62)  评论(0编辑  收藏  举报