Skip to content

Commit c1d94fd

Browse files
committed
MD fixes 2
1 parent 8028299 commit c1d94fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

source/fundamentals/bson.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,11 @@ operation:
234234

235235
.. code-block:: go
236236

237-
myCollection := client.Database("school").Collection("students")
237+
coll := client.Database("school").Collection("students")
238238
filter := bson.D{{"age", 8}}
239239

240240
var result bson.D
241-
cursor := myCollection.FindOne(context.TODO(), filter)
242-
err = cursor.Decode(&result)
241+
err := coll.FindOne(context.TODO(), filter).Decode(&result)
243242
...
244243

245244
fmt.Println(result)

0 commit comments

Comments
 (0)