此版本的文档已存档,不再提供支持。要升级5.0部署,请参阅 MongoDB 6.0升级程序。
$showDiskLoc
$showDiskLoc
选项将字段$diskLoc
添加到返回的文档。 添加的$diskLoc
字段的值是包含磁盘位置信息的文档:"$diskLoc": { "file": <int>, "offset": <int> } mongosh
为$showDiskLoc
提供了cursor.showDiskLoc()
方法db.collection.find().showDiskLoc() 您还可以通过以下任一形式指定
$showDiskLoc
选项:db.collection.find( { <query> } )._addSpecial("$showDiskLoc" , true) db.collection.find( { $query: { <query> }, $showDiskLoc: true } )