Skip to content

Commit 241a5e2

Browse files
committed
remove comments from snippet and spacing fix
1 parent 72778be commit 241a5e2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

source/includes/indexes/compound.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
collection = database[:movies]
1515
# end-sample-data
1616

17-
# start-index-compound
1817
# Creates an index on the "runtime" and "year" field
18+
# start-index-compound
1919
collection.indexes.create_one({ runtime: -1, year: 1 })
2020
# end-index-compound
2121

22+
# Finds a document with the specified runtime and release year by using the newly created index
2223
# start-index-compound-query
23-
# Finds a document with the specified runtime and release year by using the
24-
# newly created index
2524
filter = { '$and' => [
2625
{ runtime: { '$gt' => 90 } },
2726
{ year: { '$gt' => 2005 } }
@@ -35,7 +34,7 @@
3534
end
3635
# end-index-compound-query
3736

38-
# start-check-compound-index
3937
# Lists all indexes on the collection
38+
# start-check-compound-index
4039
puts collection.indexes.collect(&:to_json)
4140
# end-check-compound-index

source/indexes/compound-index.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ in ascending order on the ``year`` field:
6464
:language: ruby
6565
:copyable:
6666

67+
To verify the index's creation, you can list the
68+
6769
Verify Index Creation
6870
---------------------
6971

7072
You can verify that the index was created by listing the indexes in the
7173
collection. You should see an index for ``runtime`` and ``year`` in the list,
7274
as shown in the following output:
7375

74-
7576
.. io-code-block::
7677
:copyable: true
7778

0 commit comments

Comments
 (0)