Skip to content

Commit 5dfa62d

Browse files
author
Chris Cho
authored
Merge pull request #199 from ccho-mongodb/DOCSP-23479
DOCSP-23479: fix Golang CRUD read methods
2 parents 037956f + b641d78 commit 5dfa62d

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

source/includes/code/go/crud-read-final-less-than.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func main() {
2626

2727
// find code goes here
2828
filter := bson.D{{"surfaceTemperatureC.mean", bson.D{{"$lt", 15}}}}
29-
cursor, err := coll.Find(context.TODO(), bson.D{})
29+
cursor, err := coll.Find(context.TODO(), filter)
3030
if err != nil {
3131
panic(err)
3232
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// find code goes here
22
filter := bson.D{{"surfaceTemperatureC.mean", bson.D{{"$lt", 15}}}}
3-
cursor, err := coll.Find(context.TODO(), bson.D{})
3+
cursor, err := coll.Find(context.TODO(), filter)
44
if err != nil {
55
panic(err)
66
}

source/includes/code/go/crud-read-find-multiple-operators-and.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ filter := bson.D{
1111
},
1212
},
1313
}
14-
cursor, err := coll.Find(context.TODO(), bson.D{})
14+
cursor, err := coll.Find(context.TODO(), filter)
1515
if err != nil {
1616
panic(err)
1717
}

source/includes/code/go/crud-read-find-multiple-operators-or.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ filter := bson.D{
1010
},
1111
}
1212

13-
cursor, err := coll.Find(context.TODO(), bson.D{})
13+
cursor, err := coll.Find(context.TODO(), filter)
1414
if err != nil {
1515
panic(err)
1616
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// find code goes here
22
filter := bson.D{{"hasRings", true}}
3-
cursor, err := coll.Find(context.TODO(), bson.D{})
3+
cursor, err := coll.Find(context.TODO(), filter)
44
if err != nil {
55
panic(err)
66
}

0 commit comments

Comments
 (0)