Mongo::Collection undefined method `insert'
问题 I'm trying to import millions of rows from another database into MongoDB. My routine for import uses MyModel.collection.insert(data_to_import) And I get NoMethodError: undefined method `insert' for #<Mongo::Collection:0x000000082bb990> /home/mika/projects/ca2/lib/tasks/data.rake:36:in `block (2 levels) in <top (required)>' /home/mika/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval' /home/mika/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>' The model is defined with