FPappy/SDFongo — pull request #1 by daniel-bryant-uk (2012-10-09 14:42:10+00:00)
Title: Fixed bug which manifested as object with null _id field being returned from insert

Hi, this code has been extremely useful to my current work project, and one bug I have noticed is that when using Spring Data to persist Object via MongoOperations any new entity with an @Id field that is null or empty at the time mongoOperations.save is called results in the entity being returned with a null _id field. When using the real MongoDB this call (with a null @Id field) results in an entity being returned with a correctly generated _id value.

I've created two test cases in FongoTest to demonstrate the bug, and have applied a simple fix in FongoDBCollection.

I hope you guys approve of the modification and approve the pull-request, as this fix could be useful to fellow Devs like me who are using Fongo to test drive Spring Data Mongo Repositories.