Neptune DB 不会将 属性 值更改为之前的值

Neptune DB doesn't change property value to the previous value

我在使用 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,我会得到正确的结果。 当我不一个接一个地查询数据库时,我遇到了同样的问题。 有人看到这样的问题吗?你知道怎么解决吗?

Neptune 默认使用设置基数。每次添加一个值时,您都会扩展该集合,因为您没有明确使用 Cardinality.single。此外,elementMap 只会 return 集合基数 属性 的一个元素。要查看它们,请改用 valueMap