0

I'm using a hosted MongoDB (2.4) service through MongoLab. They don't allow eval command and I need to copy a collection to a history collection nightly. We're using the official C# driver and I have to do this from within my C# code (I can't run mongodump or execute a shell). The options I've found are

  1. eval with 'copyTo', but that's not allowed
  2. server-side find().forEach, but I can't find a way to do this query in the C# MongoDriver (CommandDocument, CommandWrapper, I can't figure out the syntax if it's even possible).
  3. client-side full copy

I'd prefer to not to do the client-side copy. Any suggestions?

Haukman
  • 3,726
  • 2
  • 21
  • 33
  • foreach query: http://stackoverflow.com/questions/8933307/clone-a-collection-in-mongodb – Haukman Jun 20 '14 at 21:59
  • I need to stay in the same database so I can't use cloneCollection since it doesn't take a target collection name. FYI – Haukman Jun 20 '14 at 22:02

0 Answers0