如何constant在 AWS Neptune 資料庫中使用 apache gremlin?
g.V().hasLabel('user').has('name', 'Thirumal1').coalesce(id(), constant("1"));
沒有在輸出中獲得恒定值。該檔案說,需要與sack https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-step-support.html一起使用。如何在 AWS Neptune 中使用常量。
uj5u.com熱心網友回復:
如果目標是在頂點不存在時回傳 1,則需要使用該fold().coalesce()模式。如問題中所述,查詢將在coalesceifhas沒有回傳結果之前結束。
你可以做這樣的事情
g.V().hasLabel('user').
has('name', 'Thirumal1').
fold().
coalesce(unfold().id(), constant("1"))
在 TinkerPop 3.6mergeV中添加了一個新步驟。一旦資料庫提供程式升級到該版本,您將能夠mergeV與onCreate和結合使用onMatch。
uj5u.com熱心網友回復:
coalesce() 步驟回傳第一個回傳值的選項。在您的查詢示例中, id() 步驟始終回傳一個值,因此它永遠不會回傳常量(“1”)。您提到的 gremlin 步驟支持關注將操作下推到資料存盤區。完全在該頁面下方顯示,僅幾個 gremlin 步驟就缺乏真正的支持。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/529638.html
