Given a string keyString, I do in my Java program the following:
ObjectId key = new Gson().fromJson(keyString, ObjectId.class);
But for this line I get this exception:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 3
What does that mean, and what I can do to solve this?