0

Using mongodump with it's query parameter fails when using a query with the Date constructor. Does anyone know why this is? E.g.

mongodump --db myDB --collection myCollection --query '{dateCreated:{$gte:new Date("2016/5/18"),$lt:new Date("2016/5/19")}}'

deepseadiving
  • 763
  • 5
  • 18

1 Answers1

0

A workaround: avoiding the date constructor altogether:

mongodump --db myDB --collection myCollection --query '{dateCreated:{$gte:new Date(1463544000000),$lt:Date(1463630400000)}}'

deepseadiving
  • 763
  • 5
  • 18