Learn R Programming

rmongodb (version 1.8.0)

mongo.undefined.create: Create a mongo.undefined object

Description

Create a mongo.undefined object for appending to a buffer with mongo.bson.buffer.append() or for embedding in a list such that mongo.bson.buffer.append.list() will properly insert an undefined value into the mongo.bson.buffer object.

Usage

mongo.undefined.create()

Arguments

Value

a mongo.undefined object

See Also

mongo.undefined, mongo.bson.buffer.append, mongo.bson.buffer.append.list, mongo.bson.buffer, mongo.bson.

Examples

Run this code
buf <- mongo.bson.buffer.create()
undef <- mongo.undefined.create()
mongo.bson.buffer.append(buf, "Undef", undef)
l <- list(u1 = undef, One = 1)
mongo.bson.buffer.append.list(buf, "listWundef", l)
b <- mongo.bson.from.buffer(buf)

# the above will create a mongo.bson object of the following form:
# { "Undef": UNDEFINED, "listWundef" : { "u1" : UNDEFINED, "One" : 1 } }

Run the code above in your browser using DataLab