Skip to content

Commit 22940c6

Browse files
author
John Van de Meulebrouck Brendgard
committed
Merge branch 'add_timestamp_to_db_docs'
2 parents bdd97e5 + 640f250 commit 22940c6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/pyop/storage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import copy
44
import pymongo
5+
from time import time
56

67

78
class MongoWrapper(object):
@@ -15,7 +16,8 @@ def __init__(self, db_uri, db_name, collection):
1516
def __setitem__(self, key, value):
1617
doc = {
1718
'lookup_key': key,
18-
'data': value
19+
'data': value,
20+
'modified_ts': time()
1921
}
2022
self._coll.update({'lookup_key': key}, doc, upsert=True)
2123

0 commit comments

Comments
 (0)