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)){
mongo.gridfile.seek(gf, 256*256*5)
data <- mongo.gridfile.read(gf, 16384)
mongo.gridfile.destroy(gf)
}
mongo.gridfs.destroy(gridfs)
}
Run the code above in your browser using DataLab