-
Notifications
You must be signed in to change notification settings - Fork 0
/
rna_db.stat.py
38 lines (31 loc) · 1005 Bytes
/
rna_db.stat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
# __author__ = 'liubinxu'
from __future__ import division
import os
from biocluster.config import Config
from bson.objectid import ObjectId
import types
import json
import re
from types import StringTypes
import gridfs
def export_stat(collect_name):
db = Config().mongo_client[Config().MONGODB + "_ref_rna"]
print collect_name
collection = db[collect_name]
#size = collection.stats()
#storageSize = collection.stats()
my_result = collection.find_one()
#print "collection:{}\tsize:{}\tstorageSize{}\n".format(collection,size,storageSize)
print my_result
return 1
def get_collections():
db = Config().mongo_client[Config().MONGODB + "_ref_rna"]
collections = db.collection_names()
#print collections
return collections
if __name__ == "__main__":
collections = get_collections()
#db = Config().mongo_client[Config().MONGODB + "_ref_rna"]
for collect_name in collections:
export_stat(collect_name)