Is the following use of next() allowed?

The update does not seem to work in this case, even when changes is a non-empty object. No error is raised, and when I printed the result, it has { value : null, done : true }.

const changes = { ... }
let v0 = g.V(0);
if (!(await v0.next()).value) {
throw Error("Vertex not found.")
}
for (const [key, value] of Object.entries(changes)) {
v0 = v0.property(key, value);
}
await v0.next();

const changes = { ... }
let v0 = g.V(0);
if (!(await v0.next()).value) {
throw Error("Vertex not found.")
}
for (const [key, value] of Object.entries(changes)) {
v0 = v0.property(key, value);
}
await v0.next();
Solution:
It turns out, no, that's not allowed. It seems like done: true signifies that the traversal sequence was already committed and I'm doing basically nothing.
Jump to solution
2 Replies
Solution
tobaseru
tobaseru11mo ago
It turns out, no, that's not allowed. It seems like done: true signifies that the traversal sequence was already committed and I'm doing basically nothing.
tobaseru
tobaseru11mo ago
Commenting out the first next() allowed the second to work.
Want results from more Discord servers?
Add your server