Method: Mongo::Index::View#create_one
- Defined in:
- lib/mongo/index/view.rb
#create_one(keys, options = {}) ⇒ Result
Note:
Note that the options listed may be subset of those available.
Creates an index on the collection.
See the MongoDB documentation for a full list of supported options by server version.
141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/mongo/index/view.rb', line 141 def create_one(keys, = {}) = .dup = {} if session = @options[:session] [:session] = session end %i(commit_quorum session).each do |key| if value = .delete(key) [key] = value end end create_many({ key: keys }.merge(), ) end |