【发布时间】:2021-11-01 10:54:38
【问题描述】:
我对 AWS Neptune DB 有一个非常奇怪的问题。我只能将属性更改为新值,并且不能使用任何以前的名称。
我正在使用 gremlin 和 node.js。
这听起来很奇怪,所以让我添加一些代码:
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
const dc = new DriverRemoteConnection(process.env.DB_URL, { authenticator, connectOnStartup: false });
await dc.open();
const g = gremlin.process.AnonymousTraversalSource.traversal().withRemote(dc);
await g.V().hasLabel('Wtf').drop().iterate();
await g.addV('Wtf').property('test', 'foo').iterate()
await g.V().hasLabel('Wtf').property('test', 'bar foo').iterate();
await g.V().hasLabel('Wtf').property('test', 'foo').iterate();
const wtf = await g.V().hasLabel('Wtf').elementMap().toList();
console.log(wtf);
所以我想我应该有这样的回应:
Map(3) {
EnumValue { typeName: 'T', elementName: 'id' } => '7cbdd4d6-9d72-905f-c4b1-0ee9a31db29a',
EnumValue { typeName: 'T', elementName: 'label' } => 'Wtf',
'test' => 'foo'
}
但我有:
Map(3) {
EnumValue { typeName: 'T', elementName: 'id' } => '7cbdd4d6-9d72-905f-c4b1-0ee9a31db29a',
EnumValue { typeName: 'T', elementName: 'label' } => 'Wtf',
'test' => 'bar foo'
}
有趣的是,如果我使用任何单个单词(不带空格)而不是 bar foo 我有正确的结果。
当我一个接一个地查询数据库时,我遇到了同样的问题。
有人看到这样的问题吗?你知道怎么解决吗?
【问题讨论】:
标签: javascript node.js amazon-web-services gremlin amazon-neptune