字符比较函数和运算符

名称描述
CONTAINS搜索包含指定字段的字符串,大小写敏感
  • CONTAINS

CONTAINS 运算符用来搜索包含指定字段的字符串,且大小写敏感。CONTAINS 运算符左右两侧必须为字符串类型。

  1. nebula> GO FROM 107 OVER serve WHERE $$.team.name CONTAINS "riors" \
  2. YIELD $^.player.name, serve.start_year, serve.end_year, $$.team.name;
  3. =====================================================================
  4. | $^.player.name | serve.start_year | serve.end_year | $$.team.name |
  5. =====================================================================
  6. | Aron Baynes | 2001 | 2009 | Warriors |
  7. ---------------------------------------------------------------------
  8. nebula> GO FROM 107 OVER serve WHERE $$.team.name CONTAINS "Riors" \
  9. YIELD $^.player.name, serve.start_year, serve.end_year, $$.team.name; -- 以下语句返回为空。
  1. nebula> GO FROM 107 OVER serve WHERE (STRING)serve.start_year CONTAINS "07" && \
  2. $^.player.name CONTAINS "Aron" \
  3. YIELD $^.player.name, serve.start_year, serve.end_year, $$.team.name;
  4. =====================================================================
  5. | $^.player.name | serve.start_year | serve.end_year | $$.team.name |
  6. =====================================================================
  7. | Aron Baynes | 2007 | 2010 | Nuggets |
  8. ---------------------------------------------------------------------
  1. nebula> GO FROM 107 OVER serve WHERE !($$.team.name CONTAINS "riors") \
  2. YIELD $^.player.name, serve.start_year, serve.end_year, $$.team.name;
  3. =====================================================================
  4. | $^.player.name | serve.start_year | serve.end_year | $$.team.name |
  5. =====================================================================
  6. | Aron Baynes | 2007 | 2010 | Nuggets |
  7. ---------------------------------------------------------------------