gpt4 book ai didi

javascript - Gremlin Javascript 折叠、合并和展开

转载 作者:行者123 更新时间:2023-12-05 09:15:07 25 4
gpt4 key购买 nike

使用 gremlin-javascript,我想执行“如果不存在则添加”事务,例如:

g.V()
.hasLabel('account').has('uid', '1')
.fold()
.coalesce(
g.V().unfold(),
g.V().addV('account').property('uid', '1')
)

我该如何表达这种查询?

最佳答案

更明确地说:

const __ = gremlin.process.statics;

g.V()
.hasLabel('account').has('uid', '1')
.fold()
.coalesce(
__.unfold(),
__.addV('account').property('uid', '1')
)

关于javascript - Gremlin Javascript 折叠、合并和展开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52982004/

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