mongo.rename: Rename a collection on a MongoDB server

Description Usage Arguments Details Value See Also Examples

View source: R/mongo.R

Description

Rename a collection on a MongoDB server.

Usage

1
mongo.rename(mongo, from.ns, to.ns)

Arguments

mongo

(mongo) A mongo connection object.

from.ns

(string) The namespace of the collection to rename.

to.ns

(string) The new namespace of the collection.

Details

Note that this may also be used to move a collection from one database to another.

Value

TRUE if successful; otherwise, FALSE.

See Also

mongo.drop.database,
mongo.drop,
mongo.command,
mongo.count,
mongo.

Examples

1
2
3
4
5
6
mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
    print(mongo.rename(mongo, "test.people", "test.humans"))

    mongo.destroy(mongo)
}

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