powered by
mongo.regex objects have "mongo.regex" as their class so that mongo.bson.buffer.append() may detect them and append the appropriate BSON regex-typed value to a buffer.
mongo.bson.buffer.append()
These mongo.regex values may also be present in a list and will be handled properly by mongo.bson.buffer.append.list() and mongo.bson.from.list().
mongo.bson.buffer.append.list()
mongo.bson.from.list()
mongo.regex.create
mongo.bson.buffer.append
mongo.bson.buffer.append.list
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