mirror of https://gitee.com/bigwinds/arangodb
handle calculated object elements in explain
This commit is contained in:
parent
e9f704ff4e
commit
d0b8af7c0b
|
@ -177,7 +177,7 @@ std::unordered_map<std::string, Function const> const Executor::FunctionNames{
|
|||
|
||||
// document functions
|
||||
{ "HAS", Function("HAS", "AQL_HAS", "az,s", true, false, true, &Functions::Has) },
|
||||
{ "ATTRIBUTES", Function("ATTRIBUTES", "AQL_ATTRIBUTES", "a|b,b", true, false, true) },
|
||||
{ "ATTRIBUTES", Function("ATTRIBUTES", "AQL_ATTRIBUTES", "a|b,b", true, false, true, &Functions::Attributes) },
|
||||
{ "VALUES", Function("VALUES", "AQL_VALUES", "a|b", true, false, true) },
|
||||
{ "MERGE", Function("MERGE", "AQL_MERGE", "a,a|+", true, false, true, &Functions::Merge) },
|
||||
{ "MERGE_RECURSIVE", Function("MERGE_RECURSIVE", "AQL_MERGE_RECURSIVE", "a,a|+", true, false, true) },
|
||||
|
|
|
@ -66,6 +66,7 @@ namespace triagens {
|
|||
static AqlValue Keep (triagens::aql::Query*, triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
|
||||
static AqlValue Merge (triagens::aql::Query*, triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
|
||||
static AqlValue Has (triagens::aql::Query*, triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
|
||||
static AqlValue Attributes (triagens::aql::Query*, triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
|
||||
static AqlValue Min (triagens::aql::Query*, triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
|
||||
static AqlValue Max (triagens::aql::Query*, triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
|
||||
static AqlValue Sum (triagens::aql::Query*, triagens::arango::AqlTransaction*, TRI_document_collection_t const*, AqlValue const);
|
||||
|
|
|
@ -327,6 +327,8 @@ function processQuery (query, explain) {
|
|||
return "{ }";
|
||||
case "object element":
|
||||
return value(JSON.stringify(node.name)) + " : " + buildExpression(node.subNodes[0]);
|
||||
case "calculated object element":
|
||||
return "[ " + buildExpression(node.subNodes[0]) + " ] : " + buildExpression(node.subNodes[1]);
|
||||
case "array":
|
||||
if (node.hasOwnProperty("subNodes")) {
|
||||
return "[ " + node.subNodes.map(buildExpression).join(", ") + " ]";
|
||||
|
|
|
@ -326,6 +326,8 @@ function processQuery (query, explain) {
|
|||
return "{ }";
|
||||
case "object element":
|
||||
return value(JSON.stringify(node.name)) + " : " + buildExpression(node.subNodes[0]);
|
||||
case "calculated object element":
|
||||
return "[ " + buildExpression(node.subNodes[0]) + " ] : " + buildExpression(node.subNodes[1]);
|
||||
case "array":
|
||||
if (node.hasOwnProperty("subNodes")) {
|
||||
return "[ " + node.subNodes.map(buildExpression).join(", ") + " ]";
|
||||
|
|
Loading…
Reference in New Issue