title: Formatting CosmosDB Gremlin Query
body: <p>I'm new to Gremlin and CosmosDB. I've been following the tinkerpop tutorials and am using the TinkerFactory.createModern() test graph.</p>
  
  <p><a href="https://i.stack.imgur.com/hcAwJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hcAwJ.png" alt="enter image description here"></a></p>
  
  <p>What I am looking for is to return a graphson object similar to this from cosmosdb. </p>
  
  <pre><code>{
  "user": {
      "name": "Marko",
      "age": 29       
  },
  "knows": [
      {"name": "josh", "age": 32},
      {"name": "vadas", "age": 27}
  ],
  "created": [
      {"name": "lop", "lang": "java"} 
  ]
  }
  </code></pre>
  
  <p>My thoughts were to try</p>
  
  <pre><code>g.V().has('name', 'marko').as('user').out('knows').as('knows').out('created').as('created').select('user', 'knows', 'created')
  </code></pre>
  
  <p>What i really get back is in the picture below.
  I was hoping to have single user object, with an array of knows objects and software objects. </p>
  
  <p>If this is possible can you please explain what steps need to be used to get this format.</p>
  
  <p><a href="https://i.stack.imgur.com/pcr20.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pcr20.png" alt="enter image description here"></a></p>
  
  <p>Hope my question is clear and thanks to anyone that can help =)</p>