Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
506 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
======= | ||
ReplSet | ||
======= | ||
|
||
------------------ | ||
Constructor | ||
------------------ | ||
|
||
|
||
ReplSet constructor provides replicaset functionality | ||
|
||
|
||
.. js:class:: ReplSet | ||
|
||
:param array list: of server objects participating in the replicaset. | ||
:param object [options]: additional options for the collection. | ||
|
||
|
||
Options | ||
- **ha** {Boolean, default:false}, turn on high availability. | ||
- **haInterval** {Number, default:2000}, time between each replicaset status check. | ||
- **reconnectWait** {Number, default:1000}, time to wait in miliseconds before attempting reconnect. | ||
- **retries** {Number, default:30}, number of times to attempt a replicaset reconnect. | ||
- **rs_name** {String}, the name of the replicaset to connect to. | ||
- **readPreference** {String}, the prefered read preference (Server.READ_PRIMARY, Server.READ_SECONDARY, Server.READ_SECONDARY_ONLY). | ||
- **read_secondary** {Boolean, deprecated}, allow reads from secondary. | ||
- **strategy** {String, default:null}, selection strategy for reads choose between (ping and statistical, default is round-robin) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
======== | ||
Server() | ||
======== | ||
|
||
------------------ | ||
Constructor | ||
------------------ | ||
|
||
|
||
Class representing a single MongoDB Server connection | ||
|
||
|
||
.. js:class:: Server() | ||
|
||
:param string host: the server host | ||
:param number port: the server port | ||
:param object [options]: optional options for insert command | ||
|
||
|
||
Options | ||
- **readPreference** {String, default:null}, set's the read preference (Server.READ_PRIMAR, Server.READ_SECONDARY_ONLY, Server.READ_SECONDARY) | ||
- **ssl** {Boolean, default:false}, use ssl connection (needs to have a mongod server with ssl support) | ||
- **slaveOk** {Boolean, default:false}, legacy option allowing reads from secondary, use **readPrefrence** instead. | ||
- **poolSize** {Number, default:1}, number of connections in the connection pool, set to 1 as default for legacy reasons. | ||
- **socketOptions** {Object, default:null}, an object containing socket options to use (noDelay:(boolean), keepAlive:(number), timeout:(number)) | ||
- **logger** {Object, default:null}, an object representing a logger that you want to use, needs to support functions debug, log, error **({error:function(message, object) {}, log:function(message, object) {}, debug:function(message, object) {}})**. | ||
- **auto_reconnect** {Boolean, default:false}, reconnect on error. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.