Skip to content

Commit

Permalink
update code example (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
mongoKart authored Jan 16, 2024
1 parent 7aa4036 commit d8ea569
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/fundamentals/indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ collection:
:language: go

coll := client.Database("sample_mflix").Collection("movies")
indexModel := mongo.IndexModel{Keys: bson.D{{"title", 1}}}
indexModel := mongo.IndexModel{Keys: bson.D{{"plot", "text"}, {"default_language", "italian"}}}
name, err := coll.Indexes().CreateOne(context.TODO(), indexModel)
if err != nil {
panic(err)
panic(err)
}

fmt.Println("Name of Index Created: " + name)
Expand Down

0 comments on commit d8ea569

Please sign in to comment.