We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5abd5f commit 48e9326Copy full SHA for 48e9326
source/includes/indexes/multikey.rb
@@ -14,13 +14,13 @@
14
collection = database[:movies]
15
# end-sample-data
16
17
-# start-index-multikey
18
# Creates an index on the "cast" field
+# start-index-multikey
19
collection.indexes.create_one({ cast: 1 })
20
# end-index-multikey
21
22
-# start-index-multikey-query
23
# Finds a document with the specified cast members by using the newly created index
+# start-index-multikey-query
24
filter = { cast: { '$all' => ['Aamir Khan', 'Kajol'] } }
25
doc = collection.find(filter).first
26
@@ -31,7 +31,7 @@
31
end
32
# end-index-multikey-query
33
34
-# start-check-multikey-index
35
# Lists all indexes on the collection
+# start-check-multikey-index
36
puts collection.indexes.collect(&:to_json)
37
# end-check-multikey-index
0 commit comments