使用cypher设置变量以便重用 - jquery

时间:2016-05-14 05:38:23

标签: jquery neo4j cypher

我做错了什么? desc返回undefined,一切都很好,直到最后一个语句。 desc在函数内部有一个值。

  function row_click(e)
  {
  var desc;
  var statement = "CYPHER runtime=compiled MATCH (m) where m.ID='" +e +"'    with m as m RETURN m.Description as desc";
      session.run(statement)
      .then (function(result) {
           var records = [];
           for (i = 0; i < result.records.length; i++) {
              records.push(result.records[i]);
              }
           return records;
          })
         .then(function(records){
             for(i = 0; i < records.length; i ++)
                  {
                      descrip=records[i].get("desc");
                  }
             desc= descrip;
         });
  console.log(desc);
  }

0 个答案:

没有答案