restx/restx — pull request #109 by ggtools (2014-06-10 07:09:21+00:00)
Title: Added @ObjectId on the userRef field to prevent Mongo from changing it.

I use a Jongo based user/credential and I noticed that when I use JongoUserRepository.setCredentials, I end up with the following error:

The _id field cannot be changed from {_id: ObjectId('5167cec5856107c479739656')} to {_id: \"5167cec5856107c479739656\"}.

I eventually find out that adding @ObjectId to the userRef field in UserCredentials solved the issue. I have a unit test for this but I don't know where to put it in the restx hierarchy since it requires connection to a Mongo database.