Database Manual / Reference / Query Language

Find Command Projection Operators查找命令投影运算符

The following pages describe specialized operators that are only available in find command projections. 以下页面描述了仅在find命令投影中可用的专用运算符。In addition to these specialized operators, find command projections can also contain non-specialized expressions.除了这些专用运算符外,find命令投影还可以包含非专用表达式

Name名称Description描述
$Projects the first element in an array that matches the query condition.投影数组中与查询条件匹配的第一个元素。
$elemMatchProjects the first element in an array that matches the specified $elemMatch condition.投影数组中与指定的$elemMatch条件匹配的第一个元素。
$metaProjects the available per-document metadata.投影每个文档的可用元数据。
$slice

Limits the number of elements projected from an array. Supports skip and limit slices.限制从数组投影的元素数量。支持跳过和限制分片。

Note

View Support查看支持

find() operations on views do not support any of the preceding projection operators.视图上的find()操作不支持前面的任何投影运算符。