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
feat(mongo): allow using different primary key types than ObjectId #568
Conversation
What do you propose? |
Correct fix is to handle this based on the metadata. If the property type is not object id, we dont want to convert it. It will be much more complex change, I don't know what and where, if I knew, it would be already implemented... But changing the platform methods is wrong I think, we should instead make sure they are not called for properties with non object id type. Also we need tests for the actual issue, where the PK is string, but it is 24 char hex string that can be converted to object id without problem (that is what #349 is about). We also need tests with numeric PK (as numbers can be also converted to object id without problems). |
I already did some changes in this manner here: 86cd027 |
it doesn't cover all the cases, I did some changes, let me know if they are better |
Good, much better! Will need more time to review it properly, but this looks like the correct way to me. |
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.
ok this looks good, please fix those few code style changes i asked for and i think we are good to merge.
or do you think there are some uncovered edge cases? i would maybe suggest adding one more test that will be about numeric PK, but the code should handle this case properly, so it should be just about adding the test case to be sure.
e9b0066
to
27da750
Compare
Good, thanks again! |
Closes #349