Hello,
When using MongoRepository with AWS DocumentDB, MongoSchemaManager.ensureSchema() fails to create the compound index of commitMetadata.properties.key and commitMetadata.properties.value in jv_snapshots, because the autogenerated index name is too long. Both MongoDB and DocumentDB limit the fully-qualified index name (<db>.<col>.$<index>) to under 128 characters, but DocumentDB places the additional restriction that the unqualified index name (<col>.$<index>) must be under 64 characters. In this case, the complete autogenerated index name, jv_snapshots.$commitMetadata.properties.key_1_commitMetadata.properties.value_1, exceeds that limit. This issue also occurs in MongoDB, if using an unusually long DB name.
Perhaps MongoSchemaManager.ensureSchema() could explicitly set a shorter index name?
Thanks!
Hello,
When using
MongoRepositorywith AWS DocumentDB,MongoSchemaManager.ensureSchema()fails to create the compound index ofcommitMetadata.properties.keyandcommitMetadata.properties.valuein jv_snapshots, because the autogenerated index name is too long. Both MongoDB and DocumentDB limit the fully-qualified index name (<db>.<col>.$<index>) to under 128 characters, but DocumentDB places the additional restriction that the unqualified index name (<col>.$<index>) must be under 64 characters. In this case, the complete autogenerated index name,jv_snapshots.$commitMetadata.properties.key_1_commitMetadata.properties.value_1, exceeds that limit. This issue also occurs in MongoDB, if using an unusually long DB name.Perhaps
MongoSchemaManager.ensureSchema()could explicitly set a shorter index name?Thanks!