6

I'm running the following command on a box that is part of a sharded replicate set. I'm just trying to export from this specific shard, I will run the same command on the other shard as well.

When I do this, Mongo should be dumping a maximum of 1.72 million records, but instead, it looks like it's trying to export the total 590 million records in the collection. Why won't the query apply and export just my selection of data?

mongodump -d obscured -c message --query "{sendDate: {\$gt: 1380499200}}" \ 
          --out=da1-messagedump --port=27018

any help would be greatly appreciated.

Bob__
  • 12,361
  • 3
  • 28
  • 42
  • I don't know the dataset, so that's why this isn't an answer, but are you wrapping the date in a Date object? Example would be: {\$gt: new Date(1380499200)}} – lewiguez Sep 16 '13 at 21:06
  • Thanks for your response. The date is actually a unix timestamp, not a Date object. – Cody Halovich Sep 16 '13 at 21:12
  • have you added verbose -v to see any additional logs. can you just post a couple of records, displaying just the sendDate – DataGuru Nov 11 '14 at 15:01

1 Answers1

1

Have you look at the documentation?

MongoDB docs

As I don't know which steps you are performing, it's complicated to guess. But apparently you need to freeze each member of the shard before exporting.

Graciano
  • 508
  • 4
  • 11
  • Welcome to Stack overflow. When posting answers, please keep in mind that having a link only is considered as bad practice since link can go broken and / or outdated and thus would not help any further reader. – β.εηοιτ.βε May 11 '15 at 20:03