You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
upsert {
query {
q(func: uid($id)) {
v as uid
usageCount as PROJECT.usageCount
u as math(usageCount+1)
}
}
mutation {
set {
uid(v) <PROJECT.usageCount> val(u) .
}
}
}
方案
通过扩展xml中标签实现
<upsertid="testUpsert">
<queryid="testQuery">
query {
q(func: uid($id)) {
v as uid
usageCount as PROJECT.usageCount
u as math(usageCount+1)
}
}
</query>
<mutationid="updateStatus">
<![CDATA[ uid(v) <PROJECT.usageCount> val(u) .]]>
</mutation>
</upsert>
验收
通过xml完成upsert
The text was updated successfully, but these errors were encountered:
背景
DgraphMapper提供了
query
和mutation
方法,但是涉及到var
的使用,需要同时提供query
和mutation
。比如: 某个记录的字段+1, 需要执行方案
通过扩展xml中标签实现
验收
通过xml完成upsert
The text was updated successfully, but these errors were encountered: