Skip to content

Commit 5fc4de6

Browse files
authored
Fix index-collect-aggregate test (#63)
* Depend on already created index and just throw if it does not exist * Improve error message * Don't check for specific node
1 parent 2a6018d commit 5fc4de6

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

simple/test.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,8 +1613,11 @@ exports.test = function (testParams) {
16131613

16141614
indexCollectAggregate = function (params) {
16151615
db._query(
1616-
"FOR doc IN @@c COLLECT group = doc.value1 AGGREGATE agg = SUM(doc.value2) RETURN [group, agg]",
1617-
{ "@c": params.collection },
1616+
"FOR doc IN @@c COLLECT group = doc.@attr AGGREGATE agg = SUM(doc.@attr) RETURN [group, agg]",
1617+
{
1618+
"@c": params.collection,
1619+
attr: params.attr
1620+
},
16181621
{},
16191622
{ silent }
16201623
);
@@ -2166,14 +2169,7 @@ exports.test = function (testParams) {
21662169
},
21672170
{
21682171
name: "aql-index-collect-aggregate",
2169-
params: {
2170-
func: indexCollectAggregate,
2171-
setup: function (params) {
2172-
drop(params);
2173-
create(params);
2174-
db[params.collection].ensureIndex({ type: "persistent", fields: ["value1", "value2"] });
2175-
}
2176-
}
2172+
params: { func: indexCollectAggregate, attr: "value1" }
21772173
},
21782174
{
21792175
name: "aql-subquery",

0 commit comments

Comments
 (0)