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

[3.x] Fix when column name includes hyphen (-) #2127

Merged
merged 4 commits into from
Oct 22, 2020
Merged

Conversation

hnassr
Copy link
Contributor

@hnassr hnassr commented Oct 19, 2020

No description provided.

@Smolevich Smolevich self-requested a review October 19, 2020 13:38
@Smolevich
Copy link
Contributor

What is the root point for this PR?
Can you show bug or problem with code in master branch?

@Smolevich
Copy link
Contributor

@hnassr
Copy link
Contributor Author

hnassr commented Oct 19, 2020

What is the root point for this PR?
Can you show bug or problem with code in master branch?

when i try this:

$users = \App\Users::where('user-phone', 'LIKE', '%123%')->get();

i got this exception:

MongoDB/Driver/Exception/CommandException with message 'ReferenceError: phone is not defined : @:1:15

@Smolevich

@divine
Copy link
Contributor

divine commented Oct 20, 2020

This fixes another "bug" that was added in #2020

@hnassr hnassr closed this Oct 21, 2020
@divine
Copy link
Contributor

divine commented Oct 21, 2020

What's the reason you've closed this PR?

@divine divine reopened this Oct 21, 2020
@hnassr
Copy link
Contributor Author

hnassr commented Oct 21, 2020

I think the problem occurred when the column name include hyphen like this user-age, so you cannot call it like this this.user-age, when i call it like this this["user-age"] the test run successfully.

gmedaglia
gmedaglia previously approved these changes Oct 21, 2020
Smolevich
Smolevich previously approved these changes Oct 21, 2020
@hnassr hnassr changed the title Fix when the value is numeric in where like Fix when column name includes hyphen (-) Oct 21, 2020
@divine divine changed the title Fix when column name includes hyphen (-) [3.x] Fix when column name includes hyphen (-) Oct 22, 2020
@divine divine merged commit a9c7410 into mongodb:master Oct 22, 2020
@divine
Copy link
Contributor

divine commented Oct 22, 2020

Thank you for contribution!

pendexgabo added a commit to pendexgabo/laravel-mongodb that referenced this pull request Oct 27, 2020
pendexgabo added a commit to pendexgabo/laravel-mongodb that referenced this pull request Oct 27, 2020
divine added a commit that referenced this pull request Oct 27, 2020
divine added a commit that referenced this pull request Oct 27, 2020
divine added a commit that referenced this pull request Feb 19, 2021
This reverts back #2020 and #2127. See explanation here: #2203
divine added a commit that referenced this pull request Feb 19, 2021
This reverts back #2020 and #2127. See explanation here: #2203
divine added a commit that referenced this pull request Feb 20, 2021
This reverts back #2020 and #2127. See explanation here: #2203
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
[3.x] Fix when column name includes hyphen (-)
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
This reverts back mongodb#2020 and mongodb#2127. See explanation here: mongodb#2203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants