Hello. When I run this search in the cli tooling I get back a result.
``
db.book.aggregate([ { “$vectorSearch”: { “index”: “vector_index”, “exact”: false, “numCandidates”: 10, “path”: “embedding”, “queryVector”: [1.2, 2.2, 3.2, 4.2], “limit”: 10 } }])
`
When I try the same search with the Go SDK, it comes back with no results.
`
pipeline := mongo.Pipeline{
{{
Key: “$vectorSearch”,
Value: bson.M{
“index”: “vector_index”,
“exact”: false,
“path”: “embedding”,
“queryVector”: float64{1.2, 2.2, 3.2, 4.2},
“numCandidates”: 10,
“limit”: 10,
}},
},
{{
Key: “$project”,
Value: bson.M{
“text”: 1,
“embedding”: 1,
“score”: bson.M{
“$meta”: “vectorSearchScore”,
},
}},
},
}
cur, err := col.Aggregate(ctx, pipeline)
`
I’ve been trying for hours and not sure how to proceed. I ran a pipeline with a simple match that did work.
go version go1.22.4 darwin/arm64 go.mongodb.org/mongo-driver v1.16.0