Skip to content

Commit ef4520f

Browse files
authored
fix in retrieve findone (#351)
1 parent 320c26d commit ef4520f

File tree

1 file changed

+1
-1
lines changed
  • source/includes/fundamentals/code-snippets/CRUD

1 file changed

+1
-1
lines changed

source/includes/fundamentals/code-snippets/CRUD/retrieve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func main() {
101101
// Retrieves a document that matches the filter and prints it as
102102
// a struct
103103
var result Tea
104-
err := coll.FindOne(context.TODO(), filter, opts).Decode(&result)
104+
err = coll.FindOne(context.TODO(), filter, opts).Decode(&result)
105105
if err != nil {
106106
if err == mongo.ErrNoDocuments {
107107
fmt.Println("No documents found")

0 commit comments

Comments
 (0)