-
Notifications
You must be signed in to change notification settings - Fork 98
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
Deep handle mongo ID_FIELD when useObjectId #309
Conversation
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.
Thank you @liuchong
Yes please add tests cases
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.
Thank you @liuchong
src/test/java/io/vertx/ext/mongo/MongoClientWithObjectIdTest.java
Outdated
Show resolved
Hide resolved
b008bd0
to
9053850
Compare
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.
Great work @liuchong !
* Deep encode key when use object id * Use deepEncodeKeyWhenUseObjectId only in query or filter * Fix deepEncodeKeyWhenUseObjectId should not use on bulk INSERT * Add unit tests for deepEncodeKeyWhenUseObjectId for MongoClient * Handle Map and List for deepEncodeKeyWhenUseObjectId
Motivation:
If we give a query when "_id" field in a nested value like:
then, the nested "_id" will not be encoded.
I added a deep version of this method for handling this, we should only need this in query or filter.
Please review this @tsegismont @vietj 👀 If this logic is acceptable, I will complete the test cases, thanks!