#!/usr/bin/env python3
# coding:utf-8
from pymongo import MongoClient
conn = MongoClient('127.0.0.1', 27017)
db = conn.eosdb
eosset = db.eosset
#q = eosset.find({"block_num": 191})
#for x in q:
# print(x)
print(x['block_num'])
q = eosset.find({"transactions":
{"$elemMatch":
{"trx.transaction.actions":
{"$elemMatch":
{"name":"newaccount"}
}
}
}
})
print("len(q)", q.count())
cnt = 0
for x in q:
transactions = x['transactions']
for t in transactions:
try:
actions = t['trx']['transaction']['actions']
for a in actions:
name = a['name']
if name == 'newaccount':
cnt += 1
except Exception as e:
pass
print(cnt)
Created
June 24, 2018 08:50
-
-
Save hashware/e7348dafd575fff7fb021447357f5f90 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment