在用于node.js的MongoDB驱动程序的2.0版本中,您可以
listCollections用来获取包含所有集合信息的游标。然后,您可以调用
toArray光标以检索信息。
db.listCollections().toArray(function(err, collInfos) { // collInfos is an array of collection info objects that look like: // { name: 'test', options: {} }});
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)