I get a "500 Internal Server Error" when calling an API method

This error is ugly but it's usually not as bad as it seems. Let's take a look at some of the problems that your code may have:

  • Update

If you get this error while updating, you may be trying to update an object without an _id field. Gamedonia needs an _id to find the object you want to update and then change it.

You may be passing the wrong argument to the Update method, like a just created object. Usually you should pass an object obtained from a search or returned in the callback of a Create or Search method. Make sure you don't pass a simple key/value Dictionary without _id.

If you are sure of what you're doing, you can also use the Update method with overwrite to true. This will try to update and overwrite and, if it doesn't find an existing object in that collection with the same _id, it will create a new one.

  • Search

Make sure your search query is sound. Maybe you forgot to close quotation marks or you tried to query for the _id field without using the $oid operator. Take a closer look at your query and see if there's something wrong there.