Justin
My feedback
4 results found
-
89 votes
An error occurred while saving the comment -
1 vote
An error occurred while saving the comment Justin commentedIts 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 commentedIt 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...
-
362 votes
Now in Public Preview: Introducing a Local Experience for Atlas, Atlas Search, and Atlas Vector Search with the Atlas CLI
Please feel to reply with feedback or leave comments. Happy to connect directly and include your team in our Early Access Program to provide additional help.
An error occurred while saving the comment Justin commentedIs this an Atlas specific feature? Or will it be available in docker versions of mongo? This is a deal breaker.
Justin supported this idea ·
@Cassio Why can't you $match after the $search?