Mongodb aggregate expression and phase

Time:2020-6-29

Aggregate expression

1. Field path expression

$field
$field.subfield

2. System variable expression

$$variable 

3. Constant expression

#$literal is used to represent a constant, that is, where $name represents the string "$name"
$literal:"$name"

Polymerization pipeline stage

$projectProject the input document again
$matchFilter input documents
$limitFilter out the first N documents in the pipeline
$skipSkip the first N documents in the pipeline
$unwindExpand array fields in the input document
$sortSort input documents
$lookupQuery the input document
$groupGroup input documents
$outExport documents in the pipeline

Recommended Today

Pit encountered by Impala

1. Use invalid metadata less and refresh table as much as possible_ NAME;2、set APPX_ COUNT_ Distinct = true is the same as NDV function, both of which are just estimates Multiple aggregate functions in one query that impala SQL does not support use distinct For example: select count (distinct ID), count (distinct uid) from table; […]