Problem loading embedded document with fromJSON


I have the following peace of code:
ODocument doc = session.newInstance(); // Where session is a previously created valid ODatabaseSession

The str is a valid JSON array (for example [“abc”, “def”, “ghi”].
I’m getting an exception "OSerializationException: Error on unmarshalling JSON content … : content must be between { }. The way I see it a JSON array is a valid JSON (and all the other databases accept it as JSON), why do I need to create a dummy entry in the string so that it looks like a JSON object - e.g. {“dummy”:[“abc”, “def”, “ghi”]}.


could you post the json code?



As I explained in the original post I’m trying to set a document to a JSON array. The JSON array starts with [ rather than the expected JSON object which starts with {.
ODocument doc = session.newInstance();
works but
ODocument doc = session.newInstance();
doesn’t although a JSON array is a valid JSON.


You need to keep a name for the json array, which is missing.


I know that. If I create a JSON object as {“name”: JSON array} it works, but my point was that a JSON array in itself is a valid JSON that is not required to be wrapped in a JSON object