gremlin javascript can't collect the properties of a vertex











up vote
0
down vote

favorite












After inserting a vertex in amazon neptune , I get the an unique id . If I want to print out the properties of a vertex , I can do it easily in gremlin console



enter image description here



But in my node js app , if I try to do the same I can't get the properties of the vertex



Here is what I have done in javascript



const fetchPropertyByVertexId = async (vertexId) => {
console.log("requsting properties of vertex "+vertexId);
return await g.V(vertexId).properties();
}


and then , I call



   fetchPropertyByVertexId(vertexId).then( property =>{
console.log(property);
});


And the output is



enter image description here



I am using this library to connect with amazon neptune .
How can I get property of a vertex , in key value pair , like I get it in gremlin console ?










share|improve this question




























    up vote
    0
    down vote

    favorite












    After inserting a vertex in amazon neptune , I get the an unique id . If I want to print out the properties of a vertex , I can do it easily in gremlin console



    enter image description here



    But in my node js app , if I try to do the same I can't get the properties of the vertex



    Here is what I have done in javascript



    const fetchPropertyByVertexId = async (vertexId) => {
    console.log("requsting properties of vertex "+vertexId);
    return await g.V(vertexId).properties();
    }


    and then , I call



       fetchPropertyByVertexId(vertexId).then( property =>{
    console.log(property);
    });


    And the output is



    enter image description here



    I am using this library to connect with amazon neptune .
    How can I get property of a vertex , in key value pair , like I get it in gremlin console ?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      After inserting a vertex in amazon neptune , I get the an unique id . If I want to print out the properties of a vertex , I can do it easily in gremlin console



      enter image description here



      But in my node js app , if I try to do the same I can't get the properties of the vertex



      Here is what I have done in javascript



      const fetchPropertyByVertexId = async (vertexId) => {
      console.log("requsting properties of vertex "+vertexId);
      return await g.V(vertexId).properties();
      }


      and then , I call



         fetchPropertyByVertexId(vertexId).then( property =>{
      console.log(property);
      });


      And the output is



      enter image description here



      I am using this library to connect with amazon neptune .
      How can I get property of a vertex , in key value pair , like I get it in gremlin console ?










      share|improve this question















      After inserting a vertex in amazon neptune , I get the an unique id . If I want to print out the properties of a vertex , I can do it easily in gremlin console



      enter image description here



      But in my node js app , if I try to do the same I can't get the properties of the vertex



      Here is what I have done in javascript



      const fetchPropertyByVertexId = async (vertexId) => {
      console.log("requsting properties of vertex "+vertexId);
      return await g.V(vertexId).properties();
      }


      and then , I call



         fetchPropertyByVertexId(vertexId).then( property =>{
      console.log(property);
      });


      And the output is



      enter image description here



      I am using this library to connect with amazon neptune .
      How can I get property of a vertex , in key value pair , like I get it in gremlin console ?







      graph-theory gremlin tinkerpop3 gremlin-server amazon-neptune






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 7 at 20:19









      Dominique Fortin

      1,493816




      1,493816










      asked Nov 7 at 7:37









      Mithun Sarker Shuvro

      1,89152038




      1,89152038
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          I think that you need to iterate your traversal. This:



          return await g.V(vertexId).properties();


          returns a Traversal object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList():



          return await g.V(vertexId).properties().toList();





          share|improve this answer





















          • Thanks a lot, it worked
            – Mithun Sarker Shuvro
            Nov 7 at 12:59











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185200%2fgremlin-javascript-cant-collect-the-properties-of-a-vertex%23new-answer', 'question_page');
          }
          );

          Post as a guest
































          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          I think that you need to iterate your traversal. This:



          return await g.V(vertexId).properties();


          returns a Traversal object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList():



          return await g.V(vertexId).properties().toList();





          share|improve this answer





















          • Thanks a lot, it worked
            – Mithun Sarker Shuvro
            Nov 7 at 12:59















          up vote
          2
          down vote



          accepted










          I think that you need to iterate your traversal. This:



          return await g.V(vertexId).properties();


          returns a Traversal object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList():



          return await g.V(vertexId).properties().toList();





          share|improve this answer





















          • Thanks a lot, it worked
            – Mithun Sarker Shuvro
            Nov 7 at 12:59













          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          I think that you need to iterate your traversal. This:



          return await g.V(vertexId).properties();


          returns a Traversal object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList():



          return await g.V(vertexId).properties().toList();





          share|improve this answer












          I think that you need to iterate your traversal. This:



          return await g.V(vertexId).properties();


          returns a Traversal object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList():



          return await g.V(vertexId).properties().toList();






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 7 at 11:28









          stephen mallette

          24.2k32675




          24.2k32675












          • Thanks a lot, it worked
            – Mithun Sarker Shuvro
            Nov 7 at 12:59


















          • Thanks a lot, it worked
            – Mithun Sarker Shuvro
            Nov 7 at 12:59
















          Thanks a lot, it worked
          – Mithun Sarker Shuvro
          Nov 7 at 12:59




          Thanks a lot, it worked
          – Mithun Sarker Shuvro
          Nov 7 at 12:59


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185200%2fgremlin-javascript-cant-collect-the-properties-of-a-vertex%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini