MongoDB and Date


I get an error message when querying a “table” in MongoDB using a date:

Command failed with error 15999: ‘exception: invalid operator ‘$dateToString’’ on server myserver:27017. The full response is { “errmsg” : “exception: invalid operator ‘$dateToString’”, “code” : 15999, “ok” : 0.0 }

When i look in the MongoDB collection the date looks like this:


Is it a bug in the Metabase MongoDB-driver or is it some issue in my environment?

Thanks and regards,

/ Mikael

In your MongoDB do you have the type for that field defined as a Date type? Are you saying the value of the fields have the actual string “ISODate” in the front of the value?

All I know is that when setting up MongoDB with Metabase is to verify that the BSON types are defined properly because it is expecting certain types. Also properly setting up the Date type opens up the better context menu in Metabase that lets you choose date ranges and specialized choices like “yesterday”.


Thanks for your answer!

I found this post, explaining that Mongodb 3.0 is required.

I tried with Mongodb 3.6, but ran into new problems. Next step will be to try MongoDB 3.0 or 3.2.


/ Mikael