morphia では、アノテーションを使用して、クラス@Index
の自動インデックスを作成できます。@Entity
コレクション名を指定してこれらのインデックスを作成しようとしていますが、その方法が見つかりませんでした。を使用すると、任意のコレクションに をAdvancedDatastore
保存できますが、 .Entity
Entity
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.