Skip to content

Commit 343569b

Browse files
committed
Tech review code improvements
1 parent 565986f commit 343569b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

source/includes/indexes/single-field.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# start-index-single
1818
# Creates an index on the "title" field
19-
index = collection.indexes.create_one({ title: 1 })
19+
collection.indexes.create_one({ title: 1 })
2020
# end-index-single
2121

2222
# start-index-single-query
@@ -33,8 +33,5 @@
3333

3434
# start-check-single-index
3535
# Lists all indexes on the collection
36-
all_indexes = collection.indexes
37-
all_indexes.each do |index_spec|
38-
puts index_spec.to_json
39-
end
36+
puts collection.indexes.collect(&:to_json)
4037
# end-check-single-index

0 commit comments

Comments
 (0)