Learn R Programming

rmongodb (version 1.8.0)

mongo.gridfile.get.md5: Get the MD5 hash of a mongo.gridfile

Description

Get the MD5 hash of a mongo.gridfile.

Usage

mongo.gridfile.get.md5(gridfile)

Arguments

gridfile
A (mongo.gridfile) object.

Value

(string) The MD5 hash (32 hex digits) of gridfile.

See Also

mongo.gridfs, mongo.gridfs.find, mongo.gridfile, mongo.gridfile.get.descriptor, mongo.gridfile.get.filename, mongo.gridfile.get.length, mongo.gridfile.get.chunk.size, mongo.gridfile.get.chunk.count, mongo.gridfile.get.content.type, mongo.gridfile.get.upload.date, mongo.gridfile.get.metadata, mongo.gridfile.get.chunk, mongo.gridfile.get.chunks, mongo.gridfile.read, mongo.gridfile.seek, mongo.gridfile.pipe.

Examples

Run this code
mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
    gridfs <- mongo.gridfs.create(mongo, "grid")
    mongo.gridfs.store.file(gridfs, "tests/test.R", "test.R")

    gf <- mongo.gridfs.find(gridfs, "test.R")
    if( !is.null(gf) ){
      print(mongo.gridfile.get.md5(gf))

      mongo.gridfile.destroy(gf)
    }
    mongo.gridfs.destroy(gridfs)
}

Run the code above in your browser using DataLab