-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
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
fix efficiency of QuerySet.bulk_create() #26
Conversation
django_mongodb/compiler.py
Outdated
inserted_id = collection.insert_one(doc, **options).inserted_id | ||
return [inserted_id] if returning_fields else [] | ||
inserted_ids = collection.insert_many(docs, **options).inserted_ids | ||
return [inserted_ids] if returning_fields else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return [inserted_ids] if returning_fields else [] | |
return inserted_ids if returning_fields else [] |
this can just be inserted_ids
now since inserted_ids
is already a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execute_sql()
must return a nested list, and since it no longer accumulates values in keys
, this is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, got it!
django_mongodb/utils.py
Outdated
@@ -18,3 +24,89 @@ def check_django_compatability(): | |||
f"You must use the latest version of django-mongodb {A}.{B}.x " | |||
f"with Django {A}.{B}.y (found django-mongodb {__version__})." | |||
) | |||
|
|||
|
|||
class CollectionDebugWrapper: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this class part of the PR? It looks to be related to getting debug information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you saw, the first commit is #25. It's a dependency of this PR but I'll merge the other PR first so it'll no longer appear here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarifications. LGTM
No description provided.