Justin
My feedback
4 results found
-
92 votes
An error occurred while saving the comment -
1 vote
An error occurred while saving the comment Justin commented
Its an aggregate pipeline so you can just add a $count pipeline step after the query. If you want the results and the count in the same query then use a facet and a $count like so:
```
db.example.aggregate([
{ $searchBeta: { ... } },
{
$facet: {
results: [{ $project: { ... } }],
total: [{ $count: "total" }]
}
}
])
``` -
41 votes
An error occurred while saving the comment Justin commented
It does for strings. For example if you had the mapping:
```
{
"analyzer": "lucene.standard",
"searchAnalyzer": "lucene.standard",
"mappings": {
"dynamic": false,
"fields": {
"values": {
"fields": {
"stringValue": {
"type": "string"
}
},
"type": "document"
}
}
}
}
```And a document in your db:
```
{
values: [
{ textValue: "here is some example text" }
}
}
```And the query:
```
db.answers.aggregate([
{
$searchBeta: {
near: {
query: "example",
path: "values.textValue"
}
}
}
])
```Then it will work...
-
67 votes
Revisiting this request, MongoDB announced plans to support search and vector search features in both MongoDB Community Edition and MongoDB Enterprise Advanced at .local NYC 2024. Work is underway on bringing these features to our self-managed offerings.
We anticipate a public preview for search and vector search on MongoDB Community edition later in 2025 and would like to move quickly on making a GA version available towards the end of 2025 or beginning of 2026. Around the time we make search and vector search features GA for MongoDB Community Edition, we anticipate a preview release of these features for MongoDB Enterprise Advanced.
Great things are in the works! Stay tuned for updates coming soon.
Justin supported this idea ·
@Cassio Why can't you $match after the $search?