Skip to content

Commit b9618ef

Browse files
committed
edits
1 parent fff473d commit b9618ef

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

snooty.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name = "ruby-driver"
22
title = "Ruby MongoDB Driver"
33
toc_landing_pages = [
44
"/get-started",
5-
"/connect"
5+
"/connect",
6+
"/indexes"
67
]
78

89
intersphinx = ["https://www.mongodb.com/docs/manual/objects.inv"]

source/includes/indexes/single-field.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88

99
# Create a new client and connect to the server
1010
client = Mongo::Client.new(uri, options)
11+
12+
# start-sample-data
1113
database = client.use('sample_mflix')
1214
collection = database[:movies]
15+
# end-sample-data
1316

1417
# start-index-single
1518
# Create an index on the "title" field
@@ -26,7 +29,7 @@
2629
puts doc.to_json
2730
else
2831
puts "No document found"
29-
end
32+
end
3033
# end-index-single-query
3134

3235
# start-check-single-index

source/indexes/single-field-index.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,19 @@ Sample Data
4444

4545
The examples in this guide use the ``movies`` collection in the
4646
``sample_mflix`` database from the :atlas:`Atlas sample datasets
47-
</sample-data>`. To learn how to create a free MongoDB Atlas cluster and
47+
</sample-data>`. To access this collection from your {+language+}
48+
application, create a ``Mongo::Client`` object that connects to
49+
an Atlas cluster and assign the following values to your ``database``
50+
and ``collection``
51+
variables:
52+
53+
.. literalinclude:: /includes/indexes/single-field.rb
54+
:start-after: start-sample-data
55+
:end-before: end-sample-data
56+
:language: ruby
57+
:copyable:
58+
59+
To learn how to create a free MongoDB Atlas cluster and
4860
load the sample datasets, see the :atlas:`Get Started with Atlas
4961
</getting-started>` guide.
5062

@@ -118,6 +130,6 @@ API Documentation
118130
To learn more about any of the methods discussed in this guide, see the
119131
following API documentation:
120132

121-
- `Collection#indexes<{+api-root+}/Mongo/Collection.html#indexes-instance_method>`__
133+
- `Collection#indexes <{+api-root+}/Mongo/Collection.html#indexes-instance_method>`__
122134
- `Index::View#create_one <{+api-root+}/Mongo/Index/View.html>`__
123135
- `Collection#find <{+api-root+}/Mongo/Collection.html#find-instance_method>`__

0 commit comments

Comments
 (0)