AxonFramework/AxonFramework — pull request #70 by andyduncan192 (2012-07-29 11:44:01+00:00)
Title: MongoEventStore sorting

I've been having gradual slowdown problems when using the MongoEventStore that I think are related to sorting in the Mongo queries.

The sort parameters in MongoEventStore are declared as Strings when MongoDB is expecting a numeric value. The consequence of this that I was coming up against was that snapshot events are not correctly reverse-sorted, so only the first snapshot is ever returned. I have some aggregates with hundreds of thousands of events, leading to lengthy loads.

In this change, I've simply changed the sort parameters to ints and added a test for multiple snapshot events. This also fixes multiple `warning: can't find plugin [-1]` log entries in MongoDB.