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

Description Usage Arguments Value See Also Examples

View source: R/gridfs.R

Description

Get the filename of a mongo.gridfile. This is the 'remote name' that is used identify the file on the server.

Usage

1

Arguments

gridfile

A (mongo.gridfile) object.

Value

(string) The filename (remote name) of gridfile

See Also

mongo.gridfs,
mongo.gridfs.find,
mongo.gridfile,
mongo.gridfile.get.descriptor,
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.metadata,
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
14
15
16
17
18
mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
    gridfs <- mongo.gridfs.create(mongo, "grid")

    # find a GridFS file uploaded midnight July 4, 2008
    buf <- mongo.bson.buffer.create()
    mongo.bson.buffer.append(buf, "uploadDate",
        strptime("07-04-2008", "%m-%d-%Y"))
    query <- mongo.bson.from.buffer(buf)

    gf <- mongo.gridfs.find(gridfs, query)
    if (!is.null(gf)) {
        print(mongo.gridfile.get.filename(gf))

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

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