mongo.gridfile.get.metadata: Get the metadata of a mongo.gridfile

Description Usage Arguments Value See Also Examples

View source: R/gridfs.R

Description

Get the metadata of a mongo.gridfile. Some applications may store metadata pertaining to a GridFS file in the "metadata" field of the descriptor. (See mongo.gridfile.get.descriptor(). This function retrieves that field as a mongo.bson object.

Usage

1

Arguments

gridfile

A (mongo.gridfile) object.

Value

(mongo.bson) The metadata of gridfile if present; otherwise, NULL.

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.md5,
mongo.gridfile.get.chunk,
mongo.gridfile.get.chunks,
mongo.gridfile.read,
mongo.gridfile.seek,
mongo.gridfile.pipe.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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.metadata(gf))

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

jonkatz2/rmongodb documentation built on May 19, 2019, 7:30 p.m.