重要
已弃用的命令
此命令已弃用,不鼓励使用,因为 MD5 不再被视为加密安全的。
定义
filemd5The
filemd5command returns the md5 hash for a single file stored using the GridFS specification. Client libraries use this command to verify that files are correctly written to MongoDB. The command takes thefiles_idof the file in question and the name of the GridFS root collection as arguments.
兼容性
此命令可用于以下环境中托管的部署:
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
注意
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本
语法
该命令具有以下语法:
db.runCommand( { filemd5: ObjectId("4f1f10e37671b50e4ecd2776"), root: "fs" } )
MongoDBfilemd5 chunks使用从collection中的每个数据块按顺序提取的 GridFS 文件对象中的所有数据来计算 。