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

MongoDB: Quoted field name if it contains dollar sign($) or dot(.) #3386

Closed
wants to merge 1 commit into from
Closed

MongoDB: Quoted field name if it contains dollar sign($) or dot(.) #3386

wants to merge 1 commit into from

Conversation

chhsiao90
Copy link
Member

@chhsiao90 chhsiao90 commented Apr 8, 2020

Fixes #3379

@cla-bot cla-bot bot added the cla-signed label Apr 8, 2020
@chhsiao90
Copy link
Member Author

Currently, I have no idea for how to add unit test for this issue. Both the embedded mongo server (v3.4.0) and mongo driver not supports dollar sign and dot.

MongoDB permits field names that contain dots (i.e. .) and dollar signs
after 3.6.
@chhsiao90
Copy link
Member Author

Force push the commit with better commit message.

Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

Could you confirm the current behavior on upstream again?
I could access the table having special characters without any change.

> use tpch;
switched to db tpch
>
>
> db.test.insertOne(
... {
...         "client" : "0.0.0.0",
...         "query" : {
...                 "expireAfterSeconds" : {
...                         "$exists" : true
...                 }
...         },
...         "user" : ""
... }
... )

presto> select * from mongodb.tpch.test;
 client  |                query                | user
---------+-------------------------------------+------
 0.0.0.0 | {expireAfterSeconds={$exists=true}} |

@ebyhr
Copy link
Member

ebyhr commented Apr 8, 2020

About testing:

  • We can upgrade to mongo:3.6.0 in MongoServer
  • There is runCommand method to skip the bson validation.

@chhsiao90
Copy link
Member Author

You are right, I can't reproduce the issue with master branch. It looks like it was already fixed in #1963. Thanks!

@chhsiao90 chhsiao90 closed this Apr 9, 2020
@chhsiao90 chhsiao90 deleted the mongo-escape-field-name branch April 13, 2020 01:34
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.

Presto failed when MongoDB has a dollar sign as their field name
2 participants