Skip to content

Commit 271a7da

Browse files
committed
code changes
1 parent 881627f commit 271a7da

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/includes/fundamentals/code-snippets/indexes/atlasSearch.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ func main() {
3333
searchStage := bson.D{{"$search", bson.D{
3434
{"text", bson.D{
3535
{"path", "title"},
36-
{"query", "baseball"},
36+
{"query", "Alabama"},
3737
}},
3838
}}}
39-
limitStage := bson.D{{"$limit", 3}}
40-
projectStage := bson.D{{"$project", bson.D{{"title", 1}, {"plot", 1}, {"_id", 0}}}}
39+
projectStage := bson.D{{"$project", bson.D{{"title", 1}}}}
4140

4241
// Runs the pipeline
43-
cursor, err := collection.Aggregate(ctx, mongo.Pipeline{searchStage, limitStage, projectStage})
42+
cursor, err := collection.Aggregate(ctx, mongo.Pipeline{searchStage, projectStage})
4443
if err != nil {
4544
panic(err)
4645
}

0 commit comments

Comments
 (0)