0

I'm getting a bizarre error in Mongo Compass (v1.2.1) with Mongo version 4.2.8

I have a simple aggregation pipeline step that compares a date and checks an equality.

However I get an unexplainable error saying: "$add only supports numeric or date types, not string"

I'm not even using $add!

Further, if I modify the second part of the expression, I get a different error saying unknown top level operator: $eq, when I can see in the docs that it clearly is

Mongo Compass Error enter image description here

CodyBugstein
  • 21,984
  • 61
  • 207
  • 363
  • What happens when you use those queries in mongo shell? – D. SM Dec 06 '20 at 23:18
  • In my NodeJS app that runs it I got no errors, but I'll try in the shell too, didn't think of that before – CodyBugstein Dec 06 '20 at 23:23
  • Also reference compass docs that say that in that field you can enter arbitrary JS. – D. SM Dec 06 '20 at 23:40
  • I've managed to isolate the issue at least.. it works when I replace `i_when_max` in the document with `new Date()`. Seems it doesn't like something about the format that comes out of the way `i_when_max` is generated... – CodyBugstein Dec 07 '20 at 01:34

0 Answers0