filter query

This commit is contained in:
ryan 2016-07-18 10:35:54 +02:00
parent 5c11fc57fa
commit 87d332479b

View File

@ -573,6 +573,7 @@ class Bigchain(object):
try: try:
# get the latest value for the vote timestamp (over all votes) # get the latest value for the vote timestamp (over all votes)
max_timestamp = r.table('votes') \ max_timestamp = r.table('votes') \
.filter(r.row['node_pubkey'] == self.me) \
.concat_map(lambda x: [x['vote']['timestamp']]) \ .concat_map(lambda x: [x['vote']['timestamp']]) \
.max() \ .max() \
.run(self.conn) .run(self.conn)