0

目的のインデックスを作成できません。既存のインデックスをリストします

System.out.println(mongo.getCollection("User").getIndexInfo());

それでも取得のみ

[{ "v" : 1 , "key" : { "_id" : 1} , "name" : "_id_1" , "ns" : "devtest01.User"}]

私は試した

mongo.getCollection("User").createIndex("syncTime");

Index indexDefinition = new Index("syncTime", Direction.ASC);
mongo.indexOps("User").ensureIndex(indexDefinition);

結果は相変わらず…

4

1 に答える 1

1

getIndexInfo() が default_id インデックスを返す理由は、MongoDB プロトコルのサポートを含め、DocumentDB がすべてを自動的にインデックス化するためです。すべてのパスは最小限のストレージとスループットのコストでインデックス化されます。DocumentDB インデックスの詳細については、https: //azure.microsoft.com/en-us/documentation/articles/documentdb-indexing-policies/ の DocumentDB インデックス ポリシーを参照してください。

getIndexInfo(); の応答の改善に取り組んでいます。当面の間、 https ://feedback.azure.com/forums/263030-documentdb の DocumentDB User Voice で直接フィードバックを提供することもできます。

于 2016-09-30T03:30:49.417 に答える