Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

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

I have very weird issue with AWS Neptune DB. I can only change property to new value and can't use any of previous names.
I'm using gremlin and node.js.
That sounds so weird so let me to add some code:

  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);

So I think I should have response like:

  Map(3) {
    EnumValue { typeName: 'T', elementName: 'id' } => '7cbdd4d6-9d72-905f-c4b1-0ee9a31db29a',
    EnumValue { typeName: 'T', elementName: 'label' } => 'Wtf',
    'test' => 'foo'
  }

but I have:

  Map(3) {
    EnumValue { typeName: 'T', elementName: 'id' } => '7cbdd4d6-9d72-905f-c4b1-0ee9a31db29a',
    EnumValue { typeName: 'T', elementName: 'label' } => 'Wtf',
    'test' => 'bar foo'
  }

Interesting thing, if I'm using any single word (without spaces) instead of bar foo I have proper result. And I have the same issue when I query database not one after another. Did someone saw such problem? Do you know how to solve it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Neptune by default uses Set cardinality. Each time you add a value you are expanding that Set as you are not explicitly using Cardinality.single. Moreover, elementMap will only return one element of a Set cardinality property. To see them all use valueMap instead.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!