You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Memgraph中`RETURN true,false`报错,求等效替代查询方案

Memgraph中RETURN true, false;报错的替代方案

直接执行RETURN true, false;会触发“Multiple results with the same name 'true' are not allowed”错误,原因是Memgraph在未指定别名时,会将布尔字面量作为列名,出现解析冲突。以下是等效的替代查询:

  • 显式指定别名(推荐写法):
RETURN true AS is_true, false AS is_false;
  • 简洁别名写法:
RETURN true:is_true, false:is_false;

这两种写法都会返回包含true和false两个布尔值的结果,完全符合原查询的预期输出。

内容的提问来源于stack exchange,提问作者ZoomZoom

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 13:52:04