Thanks to visit codestin.com
Credit goes to github.com

Skip to content

way to solve "Query failed with error code 2 and error message 'Field 'locale' is invalid in: { locale: "roles" }'" exception #2

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

Open
MilkSF opened this issue May 12, 2022 · 1 comment

Comments

@MilkSF
Copy link

MilkSF commented May 12, 2022

If you find the following exception:

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; 
nested exception is org.springframework.data.mongodb.UncategorizedMongoDbException: 
Query failed with error code 2 and error message 'Field 'locale' is invalid in: { locale: "roles" }' on server localhost:27017; 
nested exception is com.mongodb.MongoQueryException: 
Query failed with error code 2 and error message 'Field 'locale' is invalid in: { locale: "roles" }' on server localhost:27017] with root cause

you can use @Document("roles") instead of @Document(collection = "roles") in Role.java,
and @Document("users") instead of @Document(collection = "users") in User.java.

@JPonchiroli
Copy link

God bless you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants