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

before, after, between should use date object instead of date string #67

Open
kyv opened this issue Jun 2, 2017 · 1 comment
Open

Comments

@kyv
Copy link

kyv commented Jun 2, 2017

In the mongodb shell I get no results if I try to pass a query such as the following: { endret: { $gte: "2014-01-01T00:00:00.000Z" } }. However, this does work for me: { endret: { $gte: new ISODate("2014-01-01T00:00:00.000Z") } }. This also works from javascript: { endret: { $gte: new Date("2014-01-01T00:00:00.000Z") } }.

Is this an error or am I missing something? maybe something changed in newer mongodb versions?

@Starefossen
Copy link
Contributor

I think this was done this because we originally had a large database where the dates were formatted as strings and not date objects if I recall correctly.

If you would like to change the implementation I would like there to be an option to toggle between strings and dates, where stings would be default until next major version.

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

No branches or pull requests

2 participants