Mongoid Discriminator Key Error

When I run db:setup, ı have a error. Error is:

message: Cannot create collection mongoid_global_discriminator_key_assignment_invalid_field_hosts with options . The following error was raised: Mongo::Error::OperationFailure: [2]: Collection name must be between 1 and 57 bytes (on srv:port). summary: The server rejected createCollection command with given collection options. This may happen when some of the options are invalid, or not supported by your version of the server. resolution: Double check that collection options for the collection mongoid_global_discriminator_key_assignment_invalid_field_hosts are valid. Consult with Ruby driver documentation and MongoDB documentation if the desired options are supported by your version of the server.

This error returns from aws documentdb. why cant ı edit this collection name?

@Onur_Kacmaz this is not a MongoDB limitation, a Ruby driver limitation or a Mongoid limitation - this is an Amazon DocumentDB naming constraint.

First of all Thanks @alexbevi, I customized db:setup command then I fix problem. My custom command deleting mongoid_global_discriminator_key_assignment_invalid_field_hosts table from booting and thus solved problem. But I am not sure this is a correct way. I guess mongoid does not support edit collection name or I dont found correct way.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.