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

add support for date lookups #9

Open
timgraham opened this issue Apr 29, 2024 · 1 comment · May be fixed by #37
Open

add support for date lookups #9

timgraham opened this issue Apr 29, 2024 · 1 comment · May be fixed by #37
Assignees

Comments

@timgraham
Copy link
Collaborator

MongoDB Engine implemented year lookups by querying by date range. That does not work for month and day lookups (those were unsupported). Regex matching could be used for year, month, and day, but nothing more advanced like day of week.

I think the $expr operator offers the greatest capability, e.g.

day = 0
db.mydatabase.mycollection.find({ 
    "$expr": { 
        "$eq": [ { "$dayOfWeek": "$date" }, day ] 
    } 
})
@timgraham timgraham self-assigned this May 1, 2024
@timgraham
Copy link
Collaborator Author

These queries don't work (without using the $dateFromString operator) unless datetimes are stored as JSON Date objects. This will probably done as part of #11.

@timgraham timgraham linked a pull request May 24, 2024 that will close this issue
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 a pull request may close this issue.

1 participant