0

I'm tring another aproach. Full dump and the daily dump of new data using:

oid=$(mongo --quiet --eval 'ObjectId.fromDate(ISODate("2017-03-29 00:10:20"))')

mongodump -q "{_id:{$gt:$oid}}" -d dbname --collection name_data

But I'm getting:

Failed: error parsing query as json: invalid character ':' looking for beginning of object key string

basante
  • 515
  • 3
  • 9
  • 20
  • Have you looked into the various options described at the [MongoDB Backup Methods](https://docs.mongodb.com/manual/core/backups/) documentation? – Vince Bowdren Mar 22 '17 at 16:17

1 Answers1

1

The first $ needs to be escaped:

mongodump -q "{_id:{\$gt:$oid}}" -d dbname --collection name_data

basante
  • 515
  • 3
  • 9
  • 20