The aggregate command can return either a cursor or store the results in a collection. When returning a cursor or storing the results in a collection, each document in the result set is subject to the BSON Document Size limit, currently 16 megabytes;
#!/usr/bin/env python import os,sys list = [] for i in range(3,50): l = os.popen("/bin/echo 'show collections'| /usr/local/mongodb/mongodb/bin/mongo 127.0.0.1:27103/数据库名|sed -n '%sp'" %i) #获取数据库的集合列表 l = l.read() if l != "": list.appen