diff --git a/source/includes/usage-examples/code-snippets/find.go b/source/includes/usage-examples/code-snippets/find.go index fe3a4d07..f44fed67 100644 --- a/source/includes/usage-examples/code-snippets/find.go +++ b/source/includes/usage-examples/code-snippets/find.go @@ -55,17 +55,18 @@ func main() { // is "Italian" filter := bson.D{{"cuisine", "Italian"}} - // Retrieves documents that match the query filer + // Retrieves documents that match the query filter cursor, err := coll.Find(context.TODO(), filter) if err != nil { panic(err) } - // end find + // Unpacks the cursor into a slice var results []Restaurant if err = cursor.All(context.TODO(), &results); err != nil { panic(err) } + // end find // Prints the results of the find operation as structs for _, result := range results { diff --git a/source/usage-examples/find.txt b/source/usage-examples/find.txt index 70309285..c8a10c8b 100644 --- a/source/usage-examples/find.txt +++ b/source/usage-examples/find.txt @@ -4,8 +4,6 @@ Find Multiple Documents ======================= -.. default-domain:: mongodb - You can find multiple documents in a collection by using the ``Find()`` method. @@ -25,7 +23,8 @@ in the ``restaurants`` collection: :dedent: The following example matches documents in the ``restaurants`` collection -in which the ``cuisine`` is "Italian", returning all documents matched: +in which the ``cuisine`` is ``"Italian"``, returns a cursor that +references the matched documents, then unpacks the documents into a slice: .. literalinclude:: /includes/usage-examples/code-snippets/find.go :start-after: begin find