Azure Cosmos db Gremlin elementMap()

Author: Daniel Gustafsson

Originally Sourced from: https://stackoverflow.com/questions/62589698/azure-cosmos-db-gremlin-elementmap

Im trying to create a gremlin query in cosmos db where the properties of all vertices are flattened.

The best i have achieved is using "valueMap"

Query

g.V('12345').valueMap(true))

Result

{
   "id": "12345",
   "label": "product",
   "name": [
     "product name"
   ],
   "description": [
     "productdescription"
   ],
}

What i am trying to achieve

{
   "id": "12345",
   "label": "product",
   "name": "product name",
   "description": "productdescription"
}

It looks like elementMap is the right way to go, but it doesnt seem to be supported in Cosmos Db.

Is there a reason why this is not supported or does a similar solution exist?