morphia では、アノテーションを使用して、クラス@Indexの自動インデックスを作成できます。@Entityコレクション名を指定してこれらのインデックスを作成しようとしていますが、その方法が見つかりませんでした。を使用すると、任意のコレクションに をAdvancedDatastore保存できますが、 .EntityEntity
advancedDatastore.ensureIndexes(Entity.class); // This will create indexes on the mapped Entities.
次のことを行う方法を探していますが、以下のような方法は見当たりませんでした。これを達成するための回避策はありますか?
advancedDatstore.ensureIndexes("exampleCollection", Entity.class); //create indexes of Entity.class for the exampleCollection.