-
Notifications
You must be signed in to change notification settings - Fork 1.1k
MongoTemplate.findAndReplace
throws Couldn't find PersistentEntity for type class org.bson.Document!
#4061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The exception is thrown because the name of the target collection cannot be derived from the given replacement type |
MongoTemplate.findAndReplace
throws Couldn't find PersistentEntity for type class org.bson.Document!
Attempting to do data migration and rename fields within nested array. But since $rename doesn't work. I am editing the document in json directly and use findAndReplace().
If I am using MongoOperations.findAndReplace() without collectionName

Throw this exception
If I am using MongoOperations.findAndReplace() with collectionName, then no exception and document is updated.

Please let me know if this is a known issue and if this is the most efficient way to rename fields in nested array.
The text was updated successfully, but these errors were encountered: