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

fix: Look for documents using an ObjectId. #12

Merged
merged 1 commit into from
Nov 25, 2020
Merged

Conversation

Artmann
Copy link
Owner

@Artmann Artmann commented Nov 25, 2020

IDs in MongoDB can be stored as either strings or Object IDs. This meant that if you created a document
and let Mongo assign an id to it, Esix wouldn't be able to find it as it was only looking for the
hex representation.

With this change, BaseModel.find(id) will look for documents with either a matching Object id or
a string representation of it.

IDs in MongoDB can be stored as either strings or Object IDs. This meant that if you created a document
and let Mongo assign an id to it, Esix wouldn't be able to find it as it was only looking for the
hex representation.

With this change, `BaseModel.find(id)` will look for documents with either a matching Object id or
a string representation of it.
@Artmann Artmann merged commit 24a3f06 into master Nov 25, 2020
@Artmann Artmann deleted the handle-mongo-ids branch November 25, 2020 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant