Method: Mongo3::Connection#create_index
- Defined in:
- lib/mongo3/connection.rb
#create_index(path_names, index, constraints) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/mongo3/connection.rb', line 49 def create_index( path_names, index, constraints ) path_name_tokens = path_names.split( "|" ) zone = path_name_tokens[1] connect_for( zone ) do |con| cltn_name = path_name_tokens.pop db_name = path_name_tokens.pop db = con.db( db_name ) cltn = db[cltn_name] cltn.create_index( index, constraints ) end end |