MongoEngine/mongoengine — pull request #65 by alonho (2012-08-07 09:48:03+00:00)
Title: saving a document with shard_key == _id failed

saving a document with shard_key == _id failed saying the shard key is immutable even though I haven't changed the _id (because save always sets the _id, even if it is unchanged).
Fixed by testing whether the _id is in the shard key before setting it.

Tests are passing in travis. (although i don't think sharding has any tests. also tested on my setup)