gpt4 book ai didi

javascript - 值未保存在 orientdb 类中

转载 作者:太空宇宙 更新时间:2023-11-04 02:35:59 24 4
gpt4 key购买 nike

我正在尝试将 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com