Skip to content

Commit b5f5aaf

Browse files
committed
tech feedback
1 parent 729a723 commit b5f5aaf

File tree

3 files changed

+12
-105
lines changed

3 files changed

+12
-105
lines changed

source/crud/query/distinct.txt

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -129,51 +129,20 @@ collection:
129129
- Matches documents in which the value of the ``cuisine`` field is ``"Tapas"``
130130
- Returns distinct values of the ``borough`` field from the matched documents
131131

132-
.. tabs::
133-
134-
.. tab:: Struct
135-
:tabid: structExample
136-
137-
The following code uses a struct to retrieve distinct values of the
138-
``borough`` field for documents in the ``restaurants`` collection that match
139-
the specified filter:
140-
141-
.. io-code-block::
142-
:copyable: true
143-
144-
.. input:: /includes/usage-examples/code-snippets/distinct.go
145-
:language: go
146-
:dedent:
147-
148-
.. output::
149-
:language: none
150-
:visible: false
151-
152-
Brooklyn
153-
Manhattan
154-
Queens
155-
156-
.. tab:: bson.D
157-
:tabid: bsonDExample
158-
159-
The following code uses a bson.D type to retrieve distinct values of the
160-
``borough`` field for documents in the ``restaurants`` collection that match
161-
the specified filter:
162-
163-
.. io-code-block::
164-
:copyable: true
132+
.. io-code-block::
133+
:copyable: true
165134

166-
.. input:: /includes/usage-examples/code-snippets/distinctBsonD.go
167-
:language: go
168-
:dedent:
135+
.. input:: /includes/usage-examples/code-snippets/distinct.go
136+
:language: go
137+
:dedent:
169138

170-
.. output::
171-
:language: none
172-
:visible: false
139+
.. output::
140+
:language: none
141+
:visible: false
173142

174-
Brooklyn
175-
Manhattan
176-
Queens
143+
Brooklyn
144+
Manhattan
145+
Queens
177146

178147
Additional Information
179148
----------------------

source/includes/usage-examples/code-snippets/distinct.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ type Restaurant struct {
2323
Grades interface{}
2424
}
2525

26-
// Creates a filter struct to use for the query
27-
type RestaurantCuisineFilter struct {
28-
Cuisine string
29-
}
30-
3126
func main() {
3227
if err := godotenv.Load(); err != nil {
3328
log.Println("No .env file found")
@@ -50,7 +45,7 @@ func main() {
5045

5146
// Filters the collection for documents where the value of cuisine is "Tapas"
5247
coll := client.Database("sample_restaurants").Collection("restaurants")
53-
filter := RestaurantCuisineFilter{Cuisine: "Tapas"}
48+
filter := bson.D{{"cuisine", "Tapas"}}
5449

5550
// Retrieves the distinct values of the "borough" field in documents
5651
// that match the filter

source/includes/usage-examples/code-snippets/distinctBsonD.go

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)