We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
appendable
._mgc.bulk_write
Consider:
from py2store import MongoStore, appendable M = appendable(MongoStore, item2kv=lambda item: ({'_id': item.pop('_id')}, item)) m = M(db_name='py2store', collection_name='annots_example') for item in d: m.append(item.copy())
Ignoring the mutability of items worry, we could also write:
m.extend(d)
which would be equivalent to the loop.
But not efficient.
Instead, we could have a definition of extend that is specific to mongoDB, and uses bulk_write.
extend
bulk_write
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider:
Ignoring the mutability of items worry, we could also write:
which would be equivalent to the loop.
But not efficient.
Instead, we could have a definition of
extend
that is specific to mongoDB, and usesbulk_write
.The text was updated successfully, but these errors were encountered: