Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
MongoDBマニュアル
/ / /

$returnKey

$returnKey

注意

v 3.2 で廃止予定

v3.2 以降、$returnKey 演算子はmongosh では非推奨です。mongoshでは、代わりにcursor.returnKey() を使用してください。

クエリの結果のインデックス フィールドのみを返します。 $returnKeytrueに設定されており、クエリが読み取り操作を実行するためにインデックスを使用しない場合、返されるドキュメントにはフィールドは含まれません。 次のいずれかの形式を使用します。

db.collection.find( { <query> } )._addSpecial( "$returnKey", true )
db.collection.find( { $query: { <query> }, $returnKey: true } )

戻る

$query