All Collections
Error Messages
I am getting a 40215 reason code when attempting to create or update an entity
I am getting a 40215 reason code when attempting to create or update an entity

May include message "Failed to update record(s) for query"

Paul Winterhalder avatar
Written by Paul Winterhalder
Updated over a week ago

40215 is the reason code that we use when our database, MongoDB, returns an unexpected error to us.

You will want to check the "status_message" that is also returned for a more detailed description of the error being returned from the database.

The most common error message is "Failed to update record(s) for query: {<query details>}".  Most of the time when this happens, it is because the JSON data that is being sent in the update contains a "$" or a "." - which are invalid in MongoDB keys.

Pro-tip:

  • You can use the brainCloud portal view the JSON data that was sent to the API method.  Just look up the user in User Monitoring, and go to the Monitoring | User Monitoring | Logs page. Find the call that failed (look for a non-200 response), and then click on the eye in the Packet Id column to view the JSON data that was sent to the method. Search for "$" and "." to find the problem.

Your feedback is important to us. Please rate this response below. Thanks! 

Did this answer your question?