Gremlin.Net.CosmosDb icon indicating copy to clipboard operation
Gremlin.Net.CosmosDb copied to clipboard

JObject vs JArray Error loading JsonReader to JObject

Open tsmccartan opened this issue 5 years ago • 1 comments

Running the default sample seems to fail, if you have more than 1 Vertex returned from the query. IVertexJsonConverter - ReadJson fails on JObject.Load (ready), as the return from cosmos gremlin db is an array of vertex from the query, and JObject.load can only accept a single element.

How is this supposed to return a lit, when it is using JObject? If I modify the code in the IVertexJsonConvert, to do a JArray.Load, then it works, but I can only return 1 Vertex.

This is the result from my GremlinGraph Query Results: This is what is being passed in the JsonReader, and this fails on loading to JObject, as it is an array.

"[ { "id": "degree-7ee68187-f1e5-4c34-91e8-d2b9758fab98", "label": "DEGREETEST", "type": "vertex", "properties": { "entity": [ { "id": "degree-7ee68187-f1e5-4c34-91e8-d2b9758fab98|entity", "value": "DEGREETEST" } ], "Degree": [ { "id": "9af733f9-22f8-41d3-bec5-c85b02b00b71", "value": "BA" } ] } }, { "id": "degree-e6adb51c-90ba-4f5c-bec7-07376ac731c1", "label": "DEGREETEST", "type": "vertex", "properties": { "entity": [ { "id": "degree-e6adb51c-90ba-4f5c-bec7-07376ac731c1|entity", "value": "DEGREETEST" } ], "Degree": [ { "id": "a13116b3-b453-45ec-946b-87095eaa181c", "value": "MBA" } ] } }, {
r\n "id": "degree-c97e4f73-508b-430f-acd8-a14e2a8d9e77", "label": "DEGREETEST", "type": "vertex", "properties": { "entity": [ { "id": "degree-c97e4f73-508b-430f-acd8-a14e2a8d9e77|entity", "value": "DEGREETEST" } ], "Degree": [ { "id": "d34d6ec9-ee9f-479f-9ebf-c9852021cc30", "value": "PHD" } ] } }]"

tsmccartan avatar Feb 16 '20 22:02 tsmccartan

I would recommend looking at https://github.com/ExRam/ExRam.Gremlinq instead of this project. I've abandoned it and don't plan on returning to it. I apologize for any wasted time!

evo-terren avatar Feb 18 '20 15:02 evo-terren