@@ -96,17 +96,15 @@ The following code calls the ``each`` method to iterate over the query results:
96
96
.. output::
97
97
:visible: false
98
98
99
- {"_id":{"$oid":"..."},"name":"Mitsubishi Motors","permalink":"mitsubishi-motors",
100
- "crunchbase_url":"http:\/\/www.crunchbase.com\/company\/mitsubishi-motors",
101
- ... }
102
-
103
- {"_id":{"$oid":"..."},"name":"Western Digital","permalink":"western-digital",
104
- "crunchbase_url":"http:\/\/www.crunchbase.com\/company\/western-digital",
105
- ... }
106
-
107
- {"_id":{"$oid":"..."},"name":"Celarayn","permalink":"celarayn","crunchbase_url":
108
- "http:\/\/www.crunchbase.com\/company\/celarayn",
109
- ... }
99
+ {"_id"=>BSON::ObjectId('...'), "name"=>"Mitsubishi Motors", "permalink"=>"mitsubishi-motors",
100
+ "crunchbase_url"=>"http://www.crunchbase.com/company/mitsubishi-motors",
101
+ "homepage_url"=>"http://www.mitsubishi-motors.com", ...}
102
+ {"_id"=>BSON::ObjectId('...'), "name"=>"Western Digital", "permalink"=>"western-digital",
103
+ "crunchbase_url"=>"http://www.crunchbase.com/company/western-digital",
104
+ "homepage_url"=>"http://www.wdc.com/en", ...}
105
+ {"_id"=>BSON::ObjectId('...'), "name"=>"Celarayn", "permalink"=>"celarayn",
106
+ "crunchbase_url"=>"http://www.crunchbase.com/company/celarayn",
107
+ "homepage_url"=>"http://www.celarayn.es", ...}
110
108
111
109
.. note:: Find All Documents
112
110
@@ -197,13 +195,26 @@ results. The following table describes some of these options:
197
195
198
196
The following example uses the ``find`` method to find all documents in which
199
197
the ``number_of_employees`` field has the value ``1000``. The example uses the
200
- ``limit`` option to return a maximum of ``5 `` results:
198
+ ``limit`` option to return a maximum of ``2 `` results:
201
199
202
- .. literalinclude:: /includes/read/retrieve.rb
203
- :language: ruby
204
- :emphasize-lines: 3
205
- :start-after: start-modify
206
- :end-before: end-modify
200
+ .. io-code-block::
201
+ :copyable:
202
+
203
+ .. input:: /includes/read/retrieve.rb
204
+ :start-after: start-modify
205
+ :end-before: end-modify
206
+ :language: ruby
207
+ :dedent:
208
+
209
+ .. output::
210
+ :visible: false
211
+
212
+ {"_id"=>BSON::ObjectId('...'), "name"=>"Akamai Technologies", "permalink"=>"akamai-technologies",
213
+ "crunchbase_url"=>"http://www.crunchbase.com/company/akamai-technologies",
214
+ "homepage_url"=>"http://www.akamai.com", ...}
215
+ {"_id"=>BSON::ObjectId('...'), "name"=>"Yodle", "permalink"=>"yodle",
216
+ "crunchbase_url"=>"http://www.crunchbase.com/company/yodle",
217
+ "homepage_url"=>"http://www.yodle.com", ...}
207
218
208
219
For a full list of options, see the API documentation for the
209
220
`find <{+api-root}/Mongo/Collection.html#find-instance_method>`__
0 commit comments