Description Usage Arguments Value See Also Examples
Retrieve an connection error code from a mongo object indicating the failure code if mongo.create() failed.
1 |
mongo |
(mongo) a mongo connection object. |
(integer) error code as follows:
0 No Error
1 No socket - Could not create socket.
2 Fail - An error occurred attempting to connect to socket
3 Address fail - An error occured calling getaddrinfo().
4 Not Master - Warning: connected to a non-master node (read-only).
5 Bad set name - given name doesn't match the replica set.
6 No Primary - Cannot find primary in replica set - connection closed.
7 I/O error - An error occured reading or writing on the socket.
8 Read size error - The response is not the expected length.
9 Command failed - The command returned with 'ok' value of 0.
10 BSON invalid - Not valid for the specified operation.
11 BSON not finished - should not occur with R driver.
mongo.create
,
mongo
1 2 3 4 5 | mongo <- mongo.create()
if (!mongo.is.connected(mongo)) {
print("Unable to connect. Error code:")
print(mongo.get.err(mongo))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.