Skip to content

MongoDB schema creation fails in AWS DocumentDB due to overly-long index name #788

@jpars

Description

@jpars

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions