ruby-on-railsmongodbmongoid3moped

Moped "invalid collection name"


I've recently upgraded mongoid to version 3.0.0 from 2.0 in my rails app. When performing an operation which saves an object (either existing or a new one) I'm getting Moped::Errors::OperationFailure: The operation: #<Moped::Protocol::Command saying that there is invalid collection name" .

full_collection_name for the object returns foo_development.$cmd, Mongoid.default_session.collections returns empty array but when i access the database through the mongo client, all the collections are in place.

my mongoid.yml

development: sessions: default: database: foo_development hosts: - localhost:27017


Solution

  • I've moved from rails 3.1.3 to rails 3.2.21 and upgraded to mongoid 3.1.1 with mongo 2.2.6 along with bson 4.0 which solved the issue