title: Gremlin querying with the depth information while traversing
body: <p>I have a use-case where users are in a hierarchy like</p>
  
  <p><strong>user1</strong> --HAS_CHILD--> <strong>user2</strong>--HAS_CHILD--> <strong>user3</strong> --HAS_CHILD--> <strong>user4</strong> </p>
  
  <p>For the given user I need to get all the cars owned by that user and all the cars owned by the children of that user. With the cars, I need to have the user(owner) as well as the depth of that user from the given user.</p>
  
  <p>Ex. The given user is <strong>user2</strong>, then user3 has depth 1, user4 has depth 2.</p>
  
  <p>I can get the car details and owner information using the following query but how can I get the <strong><em>childDepth</em></strong> ?. </p>
  
  <pre><code>g.V().has("User", "id", "user2")
   .union(
      __.out("OWNS").hasLabel("Car"),
      __.repeat(
         __.out("HAS_CHILD").hasLabel("User")
      ).emit().out("OWNS").hasLabel("Car")
   )
   .project("plateNumber", "owner", "model", "year", "childDepth")
   .by(__.values("plateNumber").fold())
   .by(__.in("OWNS").values("owner").fold())
   .by(__.values("model").fold())
   .by(__.values("year").fold())
   .by(???)
  </code></pre>