I have an array of objects that I want to sort by random. For this case I can use array.shuffle. But what if I want to reproduce that order later on the same array? Is there any way that I can provide a seed, random number, whatever, so that I can reproduce this sequence later?

I want to generate a random list of objects from a MongoDB database (using MongoID), and that list has to be reproduced later. But as far as I know, there is no really good way, to implement a random sort directly in MongoDB. There could be a lot of objects (>1,000,000), but computation time is for the first try not the fact that matters.

Edit
Report