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
- eval with 'copyTo', but that's not allowed
- 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).
- client-side full copy
I'd prefer to not to do the client-side copy. Any suggestions?