Learn R Programming

rmongodb (version 1.8.0)

mongo.gridfile.destroy: Destroy a mongo.gridfile object

Description

Releases the resources associated with a mongo.gridfile object. These are created by mongo.gridfs.find().

Usage

mongo.gridfile.destroy(gridfile)

Arguments

gridfile
A (mongo.gridfile) object.

Details

It is not absolutely necessary to call this function since R's garbage collection will eventually get around to doing it for you.

See Also

mongo.gridfs.find, mongo.gridfile, mongo.gridfs.

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.upload.date(gf))
      mongo.gridfile.destroy(gf)
    }
    mongo.gridfs.destroy(gridfs)
}

Run the code above in your browser using DataLab