Skip to main content
Version: v3.x (DDN)

Supported aggregation pipeline features

Native queries use aggregation pipelines as the format for custom MongoDB queries. Native query configurations must include type declarations for inputs and outputs for the native query's pipeline. The DDN CLI is able to type check aggregation pipelines to write type declarations automatically (see Manage native queries with the DDN CLI). But this feature is in beta, and only supports a subset of aggregation pipeline features.

Supported pipeline stages

An aggregation pipeline is a list of aggregation stages that each filter, transform, or sort documents that flow through them. Hasura's beta pipeline type inference currently supports these stages:

StageConnector Version
$documents1.5.0
$group1.5.0
$limit1.5.0
$match1.5.0
$project1.5.0
$replaceRoot1.5.0
$replaceWith1.5.0
$skip1.5.0
$sort1.5.0
$unwind1.5.0

Supported query predicate operators

Certain stages, such as $match, use a specific format called a query predicate. These are not general purpose expressions - they are specialized for determining a match against an input document. Hasura's beta pipeline type inference currently supports these query predicate operators:

Query Predicate OperatorConnector Version
$all1.5.0
$and / $or / $nor1.5.0
$elemMatch1.5.0
$eq / $ne / $gt / $lt / $gte / $lte1.5.0
$exists1.5.0
$expr1.5.0
$in / $nin1.5.0
$mod1.5.0
$not1.5.0
$size1.5.0
$type1.5.0

Supported aggregation expression operators

Aggregation pipelines use aggregation expressions to reference document values, or to express logic. Note that these are not the operators typically used in the $match stage, but you do see these in, for example, $replaceWith and $project stages.

Hasura's beta pipeline type inference currently supports these aggregation expression operators:

Expression OperatorConnector Version
$abs1.5.0
$add / $divide / $multiply / $subtract1.5.0
$allElementsTrue / $anyElementTrue1.5.0
$and / $or1.5.0
$arrayElemAt1.5.0
$eq / $gt / $gte / $lt / $lte / $ne1.5.0
$not1.5.0
$sin / $cos / $tan / $asin / $acos / $atan / $asinh / $acosh / $atanh / $sinh / $cosh / $tanh1.5.0
$split1.5.0

Supported accumulators

Accumulators are used in stages like $group and $bucket.

Hasura's beta pipeline type inference currently supports these accumulators:

AccumulatorConnector Version
$avg1.5.0
$count1.5.0
$min / $max1.5.0
$push1.5.0
$sum1.5.0