@@ -14,35 +14,50 @@ Example
1414
1515.. include:: /includes/usage-examples/run-example-tip.rst
1616
17- The following example matches documents in the ``movies`` collection
18- in which the ``title`` is "The Room", returning the first document
17+ This example uses the following ``Restaurant`` struct as a model for documents
18+ in the ``restaurants`` collection:
19+
20+ .. literalinclude:: /includes/usage-examples/code-snippets/findOne.go
21+ :start-after: start-restaurant-struct
22+ :end-before: end-restaurant-struct
23+ :language: go
24+ :copyable:
25+ :dedent:
26+
27+ The following example matches documents in the ``restaurants`` collection
28+ in which the ``name`` is "Bagels N Buns", returning the first document
1929matched:
2030
2131.. literalinclude:: /includes/usage-examples/code-snippets/findOne.go
2232 :start-after: begin findOne
2333 :end-before: end findOne
2434 :language: go
2535 :dedent:
26- :emphasize-lines: 4
36+ :emphasize-lines: 5
2737
2838View a `fully runnable example <{+example+}/findOne.go>`__
2939
3040Expected Result
3141---------------
3242
33- After you run the full example, it returns a ``SingleResult``
34- object that contains the following document :
43+ Running the full example prints the following document, which is stored in the
44+ ``result`` variable as a ``Restaurant`` struct :
3545
3646.. code-block:: json
3747 :copyable: False
3848
49+ // results truncated
3950 {
40- ...
41- "title": "The Room",
42- "year": 2003,
43- ...
51+ "ID": "5eb3d668b31de5d588f42950",
52+ "Name": "Bagels N Buns",
53+ "RestaurantId": "40363427"
54+ "Address": [...],
55+ "Borough": "Staten Island",
56+ "Cuisine": "Delicatessen",
57+ "Grades": [...]
4458 }
4559
60+
4661Additional Information
4762----------------------
4863
0 commit comments