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

Deep handle mongo ID_FIELD when useObjectId #309

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

liuchong
Copy link
Contributor

Motivation:

If we give a query when "_id" field in a nested value like:

{
   "$and":[
      {
         "_id":"an-id-field"
      },
      {
         "some":"other"
      }
   ]
}

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!

Copy link
Contributor

@tsegismont tsegismont left a 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

Copy link
Contributor

@tsegismont tsegismont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @liuchong

@liuchong liuchong force-pushed the deep-handle-use-object-id branch from b008bd0 to 9053850 Compare November 8, 2023 09:43
Copy link
Contributor

@tsegismont tsegismont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @liuchong !

@tsegismont tsegismont merged commit d047778 into vert-x3:master Nov 8, 2023
3 checks passed
tsegismont pushed a commit that referenced this pull request Nov 8, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants