Mongodump / Mongorestore Changes Date Type to String

Hi all,

We have a process of working with mongodb dumps. The flow is as follows:

  1. Make a dump on production DB using the following command:
    mongodump --uri ${DB_URI} --gzip --archive="${archive}"
  2. Make a restore on dev DB using the following command:
    mongorestore --uri ${mongo.uri} --drop --gzip --archive="$dumpPath" --nsInclude="${mongo.sourceDatabase}.${mongo.sourceCollection}" --nsFrom="${mongo.sourceDatabase}.${mongo.sourceCollection}" --nsTo="${mongo.targetDatabase}.${mongo.targetCollection}

Both DBs have the same 4.2.5 version

Everything works great, except the fact that Date data type gets converted into String data type (at least this is what we see exploring the collection items) + Date format is changed from Instant (2019-06-15 11:45:58.364Z) to something having the time zone (2019-06-15T11:45:58.364+00:00)