简体   繁体   English

ArangoDB通过UPDATE设置为true或false

[英]ArangoDB set true or false by UPDATE

i would like IF in to query. 我想查询中频。 IF set i.eye 'true' then set 'false' by UPDATE 如果将i.eye设置为'true',然后通过UPDATE设置'false'

Example: 例:

FOR i IN plannavi FILTER i.user_key == @uk AND i._key == @key UPDATE i WITH {i.eye: i.eye == true ? false : true} IN plannavi

What's the Problem? 有什么问题?

That query should work, if you want to toggle i.eye you can either do what you did or this: {i.eye: !i.eye} . 该查询应该可以工作,如果您想切换i.eye ,则可以执行您的操作或执行以下操作: {i.eye: !i.eye}

If you're having issues, you may want to confirm the i._key == @key filter option, because if you are filtering on key, it wouldn't be expected to filter on another field. 如果遇到问题,则可能需要确认i._key == @key过滤器选项,因为如果您要过滤键,则不会希望它过滤另一个字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM