Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 717 Bytes

File metadata and controls

49 lines (37 loc) · 717 Bytes

逻辑运算符

名称 描述
&& 逻辑与 AND
! 逻辑非 NOT
|| 逻辑或 OR
XOR 逻辑异或 XOR

在 nGQL 中,非 0 数字将被视为 true 。逻辑运算符的优先级参见 Operator Precedence

  • &&

逻辑与 AND:

nebula> YIELD -1 && true;
================
| (-(1)&&true) |
================
| true         |
----------------
  • !

逻辑非 NOT:

nebula> YIELD !(-1);
===========
| !(-(1)) |
===========
| false   |
-----------

  • ||

逻辑或 OR:

nebula> YIELD 1 || !1;
=============
| (1||!(1)) |
=============
| true      |