only print collections starting with dbs

This commit is contained in:
Mike Dirolf 2009-02-04 10:24:25 -05:00
parent 312f8c3cf3
commit ff8a59125c

View File

@ -87,11 +87,11 @@ def dbs(db, out):
db.dbs_1.save({"foo": "bar"})
db.dbs_2.save({"psi": "phi"})
print >>out, db.name()
for name in sorted(db.collection_names()):
for name in [n for n in sorted(db.collection_names()) if n.startswith("dbs")]:
print >>out, name
db.drop_collection(db.dbs_1)
db.create_collection("dbs_3")
for name in sorted(db.collection_names()):
for name in [n for n in sorted(db.collection_names()) if n.startswith("dbs")]:
print >>out, name
def main(test, out_file):