New in version 2.6.
Returns the metadata associated with a document in a pipeline operations, e.g.
"textScore"when performing text search.
$metaexpression has the following syntax:
$metaexpression can specify the following keyword as the
Keyword Description Sort Order
Returns the score associated with the corresponding
$textquery for each matching document. The text score signifies how well the document matched the search term or terms. If not used in conjunction with a
$textquery, returns a score of null.
Views do not support text search.
articles collection with the following documents:
The following aggregation operation performs a text search and use the
$meta operator to group by the text search score:
The operation returns the following results:
For more examples, see Text Search in the Aggregation Pipeline.