翻译或纠错本页面
- Reference >
- Operators >
- Query Modifiers >
- $showDiskLoc
$showDiskLoc¶
- $showDiskLoc¶
注解
$showDiskLoc option adds a field $diskLoc to the returned documents. The value of the added $diskLoc field is a document that contains the disk location information:
"$diskLoc": { "file": <int>, "offset": <int> }
The mongo shell provides the cursor.showDiskLoc() method for $showDiskLoc:
db.collection.find().showDiskLoc()
You can also specify the $showDiskLoc option in either of the following forms:
db.collection.find( { <query> } )._addSpecial("$showDiskLoc" , true) db.collection.find( { $query: { <query> }, $showDiskLoc: true } )