File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 15
15
16
16
# Iterates over and prints all documents that have a "name" value of "Dunkin' Donuts"
17
17
# start-cursor-iterate
18
- cursor = collection . find ( { name : "Dunkin' Donuts" } )
18
+ cursor = collection . find ( name : "Dunkin' Donuts" )
19
19
cursor . each do |doc |
20
20
puts doc
21
21
end
22
22
# end-cursor-iterate
23
23
24
24
# Retrieves and prints the first document stored in the cursor
25
25
# start-cursor-first
26
- cursor = collection . find ( { name : "Dunkin' Donuts" } )
26
+ cursor = collection . find ( name : "Dunkin' Donuts" )
27
27
first_doc = cursor . first
28
28
puts first_doc
29
29
# end-cursor-first
30
30
31
31
# Converts the documents stored in a cursor to an array
32
32
# start-cursor-array
33
- cursor = collection . find ( { name : "Dunkin' Donuts" } )
33
+ cursor = collection . find ( name : "Dunkin' Donuts" )
34
34
array_results = cursor . to_a
35
35
# end-cursor-array
36
36
You can’t perform that action at this time.
0 commit comments