|
| 1 | +.. _data-lake-agg-support: |
| 2 | + |
| 3 | +=================================================== |
| 4 | +Supported Aggregation Pipeline Stages and Operators |
| 5 | +=================================================== |
| 6 | + |
| 7 | +This page describes the MongoDB :manual:`aggregation </aggregation/>` |
| 8 | +pipeline :manual:`stages </reference/operator/aggregation-pipeline/>` |
| 9 | +and :manual:`operators </reference/operator/aggregation/>` that {+adl+} |
| 10 | +supports. |
| 11 | + |
| 12 | +.. note:: |
| 13 | + |
| 14 | + .. include:: /includes/fact-doc-order-in-query-result.rst |
| 15 | + |
| 16 | +.. _supported-stages: |
| 17 | + |
| 18 | +Supported and Unsupported Aggregation Pipeline Stages |
| 19 | +----------------------------------------------------- |
| 20 | + |
| 21 | +{+adl+} supports all the aggregation pipeline stages except the |
| 22 | +following: |
| 23 | + |
| 24 | +- :pipeline:`$indexStats` |
| 25 | +- :pipeline:`$listSessions` |
| 26 | +- :pipeline:`$listLocalSessions` |
| 27 | +- :pipeline:`$merge` |
| 28 | +- :pipeline:`$planCacheStats` |
| 29 | + |
| 30 | +For the following stages in {+adl+} queries, {+adl+} introduces an |
| 31 | +alternate syntax, includes a caveat, or deviates from :manual:`server |
| 32 | +</reference/operator/aggregation-pipeline/>`. See the *Description* |
| 33 | +column for details. |
| 34 | + |
| 35 | +.. list-table:: |
| 36 | + :header-rows: 1 |
| 37 | + :widths: 30 70 |
| 38 | + |
| 39 | + * - Pipeline Stage |
| 40 | + - Description |
| 41 | + |
| 42 | + * - :pipeline:`$geoNear` |
| 43 | + - Outputs documents in order of nearest to farthest from a |
| 44 | + specified point. {+adl+} supports :pipeline:`$geoNear` in |
| 45 | + queries on {+dl+} collections that are mapped to one |service| |
| 46 | + collection only. {+adl+} doesn't support :pipeline:`$geoNear` |
| 47 | + for: |
| 48 | + |
| 49 | + - |s3| or |http| {+data-lake-stores+}. |
| 50 | + - Queries on {+dl+} collections that are mapped to multiple |
| 51 | + |service| collections. |
| 52 | + |
| 53 | + See :ref:`query-atlas` for more information. |
| 54 | + |
| 55 | + * - :pipeline:`$graphLookup` |
| 56 | + - Performs a recursive search on a collection. {+adl+} supports |
| 57 | + :pipeline:`$graphLookup` in queries on {+dl+} collections |
| 58 | + that are mapped to one |service| collection only. {+adl+} |
| 59 | + doesn't support :pipeline:`$graphLookup` for: |
| 60 | + |
| 61 | + - |s3| or |http| {+data-lake-stores+}. |
| 62 | + - Queries on {+dl+} collections that are mapped to multiple |
| 63 | + |service| collections. |
| 64 | + |
| 65 | + See :ref:`query-atlas` for more information. |
| 66 | + |
| 67 | + * - :pipeline:`$lookup` |
| 68 | + - Performs a left outer join to a collection in the same database. |
| 69 | + {+adl+} provides syntax for joining collections from different |
| 70 | + databases also. See :ref:`adl-lookup-stage` for more information. |
| 71 | + |
| 72 | + * - :pipeline:`$match` |
| 73 | + - Filters the documents to pass only the documents that match the |
| 74 | + specified condition(s) to the next pipeline stage. {+adl+} |
| 75 | + supports :pipeline:`$match`. Note that the :ref:`partition |
| 76 | + attributes <datalake-path-attribute-types>` for selecting |
| 77 | + specific files on |s3| are only optimized for the following |
| 78 | + :manual:`aggregation pipeline operators |
| 79 | + </reference/operator/aggregation/>`: :manual:`$eq |
| 80 | + </reference/operator/aggregation/eq/>`, :manual:`$gt |
| 81 | + </reference/operator/aggregation/gt/>`, :manual:`$lt |
| 82 | + </reference/operator/aggregation/lt/>`, :manual:`$gte |
| 83 | + </reference/operator/aggregation/gte/>`, :manual:`$lte |
| 84 | + </reference/operator/aggregation/lte/>`, :manual:`$ne |
| 85 | + </reference/operator/aggregation/ne/>`, :manual:`$and |
| 86 | + </reference/operator/aggregation/and/>`, :manual:`$or |
| 87 | + </reference/operator/aggregation/or/>`. |
| 88 | + |
| 89 | + * - :pipeline:`$out` |
| 90 | + - Takes the documents returned by the aggregation pipeline and |
| 91 | + writes them to a specified collection. {+adl+} provides |
| 92 | + alternate syntax for writing to |s3| and |service| cluster. See |
| 93 | + :ref:`adl-out-stage` for more information. |
| 94 | + |
| 95 | + * - :pipeline:`$sample` |
| 96 | + - Randomly selects the specified number of documents from its |
| 97 | + input. {+adl+} supports ``$sample``, but does not provide a |
| 98 | + truly random sample and returns the first set of documents that |
| 99 | + it finds. |
| 100 | + |
| 101 | + * - :pipeline:`$skip` |
| 102 | + - Skips over the specified number of documents that pass into the |
| 103 | + stage and passes the remaining documents to the next stage in |
| 104 | + the pipeline. {+adl+} supports ``$skip``, but this does not |
| 105 | + reduce data scan because {+dl+} accesses all partitions that |
| 106 | + correspond to your query. |
| 107 | + |
| 108 | +.. _supported-operators: |
| 109 | + |
| 110 | +Supported Aggregation Pipeline Operators |
| 111 | +---------------------------------------- |
| 112 | + |
| 113 | +{+adl+} supports all the aggregation pipeline operators. However, |
| 114 | +{+adl+} supports all the :manual:`geospatial query operators |
| 115 | +</reference/operator/query-geospatial/>` and the following |
| 116 | +:manual:`evaluation query operators |
| 117 | +</reference/operator/query-evaluation/>` only in queries on |
| 118 | +collections that are mapped to an |service| cluster data store: |
| 119 | + |
| 120 | +.. list-table:: |
| 121 | + :header-rows: 1 |
| 122 | + :widths: 30 70 |
| 123 | + |
| 124 | + * - Pipeline Stage |
| 125 | + - Description |
| 126 | + |
| 127 | + * - :manual:`$text </reference/operator/query/text/>` |
| 128 | + - Performs a text search on the content of the fields indexed with |
| 129 | + a text index. |
| 130 | + |
| 131 | + * - :manual:`$where </reference/operator/query/where/>` |
| 132 | + - Passes either a string containing a JavaScript expression or a |
| 133 | + full JavaScript function to the query system. |
0 commit comments