Description Usage Arguments See Also Examples
Send a "reset error" command to the server, it also resets the values
returned by
mongo.get.server.err()
and
mongo.get.server.err.string()
.
1 | mongo.reset.err(mongo, db)
|
mongo |
(mongo) a mongo connection object. |
db |
(string) The name of the database on which to reset the error status. |
mongo.get.server.err
,
mongo.get.server.err.string
,
mongo.get.last.err
,
mongo.get.prev.err
,
mongo.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
# try adding a duplicate record when index doesn't allow this
db <- "test"
ns <- "test.people"
mongo.index.create(mongo, ns, '{"name":1}', mongo.index.unique)
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "name", "John")
mongo.bson.buffer.append(buf, "age", 22L)
b <- mongo.bson.from.buffer(buf)
mongo.insert(mongo, ns, b);
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "name", "John")
mongo.bson.buffer.append(buf, "age", 27L)
b <- mongo.bson.from.buffer(buf)
mongo.insert(mongo, ns, b);
err <- mongo.get.last.err(mongo, db)
print(mongo.get.server.err(mongo))
print(mongo.get.server.err.string(mongo))
mongo.reset.err(mongo, db)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.