Skip to content

Convert ALL DateTime values to UTCDateTime in Query\Builder::compileWheres #1375

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

Closed
wants to merge 1 commit into from

Conversation

D-02022020
Copy link

$builder->where('timestamp', '>=', $carbonDateObject1)->where('timestamp', '<=', $carbonDateObject2)

was working, but

$builder->whereBetween('timestamp', [$carbonDateObject1, $carbonDateObject2])

wasn't.

This was because in the compileWheres function only converted $where['value'] to UTCDateTime, but not $where['values'], where the former was filled in easy queries and the latter one in between queries. MongoDB then couldn't handle the given Carbon objects (possibly autoconverted to strings)

@D-02022020
Copy link
Author

oh, I see it's a duplicate of https://github.com/jenssegers/laravel-mongodb/pull/953/files , but that one has merge conflicts

@D-02022020
Copy link
Author

#1328 contains the exact same diff and has been merged

@D-02022020 D-02022020 closed this Jan 22, 2018
@D-02022020 D-02022020 deleted the wherebetween-fix branch January 22, 2018 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant