javascript - 值未保存在 orientdb 类中

标签 javascript node.js orientdb

我正在尝试将 JS 对象保存到 orientdb 类,但值本身并不持久。 “纪录”的创造是艰难的。

我正在遵循这个例子: https://github.com/nitrog7/node-orientdb/wiki/Graph-Database#wiki-create-a-new-vertex

Node 版本:v0.10.26

orientdb版本:orientdb-community-1.7-rc1

var vertex = {
    '@class':'People',
    'id':'123',
    'name':'Giraldo'
};

db.vertexCreate(vertex)
.then(function(results){
    console.log(results);
})
.error(function(error){
    console.log('Error creating a vertex:', error);
});

结果:

{ '@class': 'p',
  '@type': 'd',
  '@version': 1,
  '@rid': { clusterId: 13, clusterPosition: 48, recordId: '#13:19' } }

架构: enter image description here

浏览到对象: enter image description here

有人知道我做错了什么吗?

最佳答案

你需要做:

db.open()
     .then(function(){

         //your code goes here

     })

如果您已经实现了上述代码,但仍然无法正常工作,那么我建议您使用executeCommand()。欲了解更多信息,请访问here .

希望您已更新到最新版本。

关于javascript - 值未保存在 orientdb 类中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22304171/

相关文章:

javascript - 什么时候 javascript 代码被认为是 GC 的垃圾

不使用模块的 Node.js 日期格式转换

database - 图数据库统计直接关系

javascript - 类型错误 : "x" is (not) "y" after destructuring an object

javascript - 这个幻灯片范围,当拖动到右端时,我想显示文本,例如 : unlimited, 我该怎么做?

javascript - 在 SailsJS 中创建条目后发送电子邮件

javascript - 登录后如何引导用户搜索结果?

etl - 通过 Orientdb ETL 添加 Edge 属性

Orientdb 阻止简单的文档插入

javascript - 如何从 url 作为字符串下载网页