Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api-reference/operators/aggregation/$graphlookup.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,5 @@ The `maxDepth` message contains a non-breaking hyphen (U+2011) rather than an AS

## Related

- [`$lookup`](./%24lookup.md) — joins a single level instead of recursing.
- [`$unwind`](./%24unwind.md) — flattens the array produced in the `as` field.
- [`$lookup`](https://documentdb.io/docs/reference/operators/aggregation/%24lookup/) — joins a single level instead of recursing.
- [`$unwind`](https://documentdb.io/docs/reference/operators/aggregation/%24unwind/) — flattens the array produced in the `as` field.
4 changes: 2 additions & 2 deletions api-reference/operators/aggregation/$limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ A value that cannot be represented as a 64-bit integer is also rejected.

## Related

- [`$skip`](./%24skip.md) — skips documents instead of truncating the result.
- [`$sort`](./%24sort.md) — order documents before limiting them.
- [`$skip`](https://documentdb.io/docs/reference/operators/aggregation/%24skip/) — skips documents instead of truncating the result.
- [`$sort`](https://documentdb.io/docs/reference/operators/aggregation/%24sort/) — order documents before limiting them.
8 changes: 4 additions & 4 deletions api-reference/operators/aggregation/$project.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ The DBRef field names `$id`, `$ref`, and `$db` are exempt, so `{ $project: { "$i

## Related

- [`$addFields`](./%24addfields.md) — adds fields while keeping all existing ones.
- [`$set`](./%24set.md) — alias for `$addFields`.
- [`$unset`](./%24unset.md) — removes fields without switching the whole stage to exclusion semantics.
- [`$meta`](../projection/%24meta.md) — surface search metadata, such as a `$vectorSearch` similarity score, as a projected field.
- [`$addFields`](https://documentdb.io/docs/reference/operators/aggregation/%24addfields/) — adds fields while keeping all existing ones.
- [`$set`](https://documentdb.io/docs/reference/operators/aggregation/%24set/) — alias for `$addFields`.
- [`$unset`](https://documentdb.io/docs/reference/operators/aggregation/%24unset/) — removes fields without switching the whole stage to exclusion semantics.
- [`$meta`](https://documentdb.io/docs/reference/operators/projection/%24meta/) — surface search metadata, such as a `$vectorSearch` similarity score, as a projected field.
10 changes: 5 additions & 5 deletions api-reference/operators/aggregation/$search.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The `$search` stage in the aggregation pipeline runs a vector similarity search

`$search` must be the first stage in the pipeline, and the field named by `path` must be covered by a vector index.

> `$search` in DocumentDB is a vector search stage. It does not accept text-search operators: a spec such as `{ $search: { text: { ... } } }` is rejected with `Unrecognized $search option: text`. For full-text queries, use the `$text` query operator against a text index. For new work, prefer [`$vectorSearch`](./%24vectorsearch.md), which is the current stage for vector search and takes a clearer spec; `$search` remains for compatibility with existing `cosmosSearch` and `knnBeta` queries.
> `$search` in DocumentDB is a vector search stage. It does not accept text-search operators: a spec such as `{ $search: { text: { ... } } }` is rejected with `Unrecognized $search option: text`. For full-text queries, use the `$text` query operator against a text index. For new work, prefer [`$vectorSearch`](https://documentdb.io/docs/reference/operators/aggregation/%24vectorsearch/), which is the current stage for vector search and takes a clearer spec; `$search` remains for compatibility with existing `cosmosSearch` and `knnBeta` queries.

## Syntax

Expand Down Expand Up @@ -121,10 +121,10 @@ db.products.aggregate([

- **`$search` must come first.** Placing it anywhere else fails with `$search must appear as the initial stage in the pipeline sequence.` The same applies when the pipeline already carries a limit ahead of it.
- **One operator per spec.** The stage rejects a spec carrying more than one search operator, and a spec carrying none.
- **`path` must be indexed.** The field named by `path` must be covered by a vector index; see [`$vectorSearch`](./%24vectorsearch.md) for creating one.
- **`path` must be indexed.** The field named by `path` must be covered by a vector index; see [`$vectorSearch`](https://documentdb.io/docs/reference/operators/aggregation/%24vectorsearch/) for creating one.

## Related content

- [`$vectorSearch`](./%24vectorsearch.md) — the current vector search stage, and the one to prefer for new queries.
- [`$project`](./%24project.md) — shape the documents returned by the search.
- [`$limit`](./%24limit.md) — narrow the result set further; `k` already bounds it.
- [`$vectorSearch`](https://documentdb.io/docs/reference/operators/aggregation/%24vectorsearch/) — the current vector search stage, and the one to prefer for new queries.
- [`$project`](https://documentdb.io/docs/reference/operators/aggregation/%24project/) — shape the documents returned by the search.
- [`$limit`](https://documentdb.io/docs/reference/operators/aggregation/%24limit/) — narrow the result set further; `k` already bounds it.
6 changes: 3 additions & 3 deletions api-reference/operators/aggregation/$vectorsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,6 @@ Documents returned by `$vectorSearch` carry an internal `__cosmos_meta__` field

## Related

- [`$limit`](./%24limit.md) — `$vectorSearch` takes its own `limit`; a later `$limit` can narrow the result further.
- [`$project`](./%24project.md) — shape the results, and surface the similarity score with `$meta`.
- [`$meta`](../projection/%24meta.md) — the metadata operator used to project `searchScore`.
- [`$limit`](https://documentdb.io/docs/reference/operators/aggregation/%24limit/) — `$vectorSearch` takes its own `limit`; a later `$limit` can narrow the result further.
- [`$project`](https://documentdb.io/docs/reference/operators/aggregation/%24project/) — shape the results, and surface the similarity score with `$meta`.
- [`$meta`](https://documentdb.io/docs/reference/operators/projection/%24meta/) — the metadata operator used to project `searchScore`.
2 changes: 1 addition & 1 deletion api-reference/operators/projection/$meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ db.collection.find({
| Keyword | Returns |
| --- | --- |
| **`textScore`** | The relevance score of a `$text` search. |
| **`searchScore`** | The similarity score of a [`$vectorSearch`](../aggregation/%24vectorsearch.md). |
| **`searchScore`** | The similarity score of a [`$vectorSearch`](https://documentdb.io/docs/reference/operators/aggregation/%24vectorsearch/). |
| **`vectorSearchScore`** | Alias for `searchScore`; the keyword MongoDB Atlas uses with `$vectorSearch`. |
| **`indexKey`** | Not supported — rejected with `Returning indexKey for $meta not supported`. |

Expand Down