This version of the documentation is archived and no longer supported. To
upgrade your 5.0 deployment, see the MongoDB 6.0 upgrade procedures.
$showDiskLocNote
Deprecated since v3.2
Starting in v3.2, the
$showDiskLocoperator is deprecated inmongosh. Inmongosh, usecursor.showRecordId()instead.$showDiskLocoption adds a field$diskLocto the returned documents. The value of the added$diskLocfield is a document that contains the disk location information:"$diskLoc": { "file": <int>, "offset": <int> } mongoshprovides thecursor.showDiskLoc()method for$showDiskLoc:db.collection.find().showDiskLoc() You can also specify the
$showDiskLocoption in either of the following forms:db.collection.find( { <query> } )._addSpecial("$showDiskLoc" , true) db.collection.find( { $query: { <query> }, $showDiskLoc: true } )