Skip to content
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

Replace count_documents with find_one #91

Closed
joelvdavies opened this issue Oct 19, 2023 · 0 comments · Fixed by #148
Closed

Replace count_documents with find_one #91

joelvdavies opened this issue Oct 19, 2023 · 0 comments · Fixed by #148
Assignees
Labels
enhancement New feature or request

Comments

@joelvdavies
Copy link
Collaborator

There are a few places e.g. the checking for children where we currently have code like

count = self._collection.count_documents({"code": code})
return count > 0

I think this should be replaced by find_one instead so it doesn't go through every single document.

@joelvdavies joelvdavies added the enhancement New feature or request label Oct 19, 2023
@MatteoGuarnaccia5 MatteoGuarnaccia5 self-assigned this Dec 19, 2023
MatteoGuarnaccia5 added a commit that referenced this issue Jan 8, 2024
MatteoGuarnaccia5 added a commit that referenced this issue Jan 8, 2024
MatteoGuarnaccia5 added a commit that referenced this issue Jan 11, 2024
MatteoGuarnaccia5 added a commit that referenced this issue Jan 11, 2024
MatteoGuarnaccia5 added a commit that referenced this issue Jan 11, 2024
joelvdavies added a commit that referenced this issue Jan 17, 2024
joelvdavies added a commit that referenced this issue Jan 18, 2024
MatteoGuarnaccia5 added a commit that referenced this issue Jan 18, 2024
MatteoGuarnaccia5 added a commit that referenced this issue Jan 22, 2024
MatteoGuarnaccia5 added a commit that referenced this issue Jan 25, 2024
…ith-find-one-#91

Replace count documents with find one #91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Archive
Development

Successfully merging a pull request may close this issue.

2 participants