Skip to content

Commit 565986f

Browse files
committed
Stephanie's reiview
1 parent de18d3c commit 565986f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

source/includes/indexes/single-field.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# Replace the placeholders with your credentials
44
uri = "<connection string>"
55

6-
# Set the server_api field of the options object to Stable API version 1
6+
# Sets the server_api field of the options object to Stable API version 1
77
options = { server_api: { version: "1" }}
88

9-
# Create a new client and connect to the server
9+
# Creates a new client and connect to the server
1010
client = Mongo::Client.new(uri, options)
1111

1212
# start-sample-data
@@ -15,13 +15,12 @@
1515
# end-sample-data
1616

1717
# start-index-single
18-
# Create an index on the "title" field
18+
# Creates an index on the "title" field
1919
index = collection.indexes.create_one({ title: 1 })
20-
puts "Index created: #{index}"
2120
# end-index-single
2221

2322
# start-index-single-query
24-
# Find a document with the title "Sweethearts"
23+
# Finds a document with the title "Sweethearts"
2524
filter = { title: 'Sweethearts' }
2625
doc = collection.find(filter).first
2726

@@ -33,7 +32,7 @@
3332
# end-index-single-query
3433

3534
# start-check-single-index
36-
# List all indexes on the collection
35+
# Lists all indexes on the collection
3736
all_indexes = collection.indexes
3837
all_indexes.each do |index_spec|
3938
puts index_spec.to_json

source/indexes/single-field-index.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ field index. The following example creates an index in ascending order on the
7373
:language: ruby
7474
:copyable:
7575

76-
Verify the Index's Creation
77-
---------------------------
76+
Verify Index Creation
77+
---------------------
7878

7979
You can verify that the index was created by iterating through the ``indexes`` object
8080
to list the indexes in the collection. You should see an index for ``title`` in

0 commit comments

Comments
 (0)