0

一意のインデックスに含まれているフィールドでdistinctを使用しようとしています。インデックス付きフィールドはどれも機能しません。他のフィールドはうまく機能します。次のコマンドを実行したときの統計出力は次のとおりです。

(インデックス付けされていないフィールド)

db.runCommand( { distinct: 'businesses', key: 'website' } )

"values" : [
    blah blah blah
],
"stats" : {
        "n" : 36,
        "nscanned" : 36,
        "nscannedObjects" : 36,
        "timems" : 0,
        "cursor" : "BasicCursor"
},
"ok" : 1

(インデックス付きフィールド)

db.runCommand( { distinct: 'businesses', key: 'state' } );

{
        "values" : [ ],
        "stats" : {
                "n" : 0,
                "nscanned" : 0,
                "nscannedObjects" : 0,
                "timems" : 0,
                "cursor" : "BtreeCursor address_1_unit_1_city_1_state_1_zip_1"
        },
        "ok" : 1
}

インデックスに含まれるフィールドで個別に使用するにはどうすればよいですか?

4

0 に答える 0