Learn R Programming

rmongodb (version 1.8.0)

mongo.regex.create: Create a mongo.regex object

Description

Create a mongo.regex object for appending to a buffer with mongo.bson.buffer.append.regex() or mongo.bson.buffer.append(), or for embedding in a list such that mongo.bson.buffer.append.list() will properly insert a regular expression value into a mongo.bson.buffer object.

Usage

mongo.regex.create(pattern, options = "")

Arguments

pattern
(string) The regular expression.
options
(string) Options governing the parsing done with the pattern.

Value

A mongo.regex object

Details

See http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-RegularExpressions

See Also

mongo.regex, mongo.bson.buffer.append, mongo.bson.buffer.append.regex, mongo.bson.buffer.append.list, mongo.bson.buffer, mongo.bson.

Examples

Run this code
buf <- mongo.bson.buffer.create()
regex <- mongo.regex.create("acme.*corp", options="i")
mongo.bson.buffer.append.regex(buf, "MatchAcme", regex)
b <- mongo.bson.from.buffer(buf)

Run the code above in your browser using DataLab