You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the Store interface provides an update method which takes a list of entire documents as an argument. That means in order to modify a single field (to add a tag for example) to documents in an already-existing database, one must do, e.g.
new_docs = []
for doc in Store.query({}):
doc["tags"].append('new_tag')
new_docs.append(doc)
Store.update(new_docs)
Which would require download the entirety of every document in the query, which can be slow and inefficient. It would be nice to have a convenience method that can add or modify fields in an existing document without having to download the whole thing.
This is currently possible in maggma by using pure pymongo on the Store._collection attribute, but I think the Store interface should expose this without requiring such detailed knowledge of pymongo.
Currently the
Store
interface provides anupdate
method which takes a list of entire documents as an argument. That means in order to modify a single field (to add a tag for example) to documents in an already-existing database, one must do, e.g.Which would require download the entirety of every document in the query, which can be slow and inefficient. It would be nice to have a convenience method that can add or modify fields in an existing document without having to download the whole thing.
This is currently possible in
maggma
by using purepymongo
on theStore._collection
attribute, but I think theStore
interface should expose this without requiring such detailed knowledge ofpymongo
.The text was updated successfully, but these errors were encountered: