Class Index | File Index

Classes


Built-In Namespace _global_

Field Summary
Field Attributes Field Name and Description
 
 
Returns a port number that has not been given out to any other caller from the same mongo shell.
 
 
 
 
Method Summary
Method Attributes Method Name and Description
 
 
_awaitRSHostViaRSMonitor(hostAddr, desiredState, rsName, timeout)
This method is intended to aid in the writing of tests.
 
_barFormat(data, width)
 
_getErrorWithCode(codeOrObj, message)
 
 
 
 
 
 
Configures 'this' bridge to accept new connections from the 'dest' of each of the 'bridges'.
 
add(config)
Adds a node to the replica set managed by this instance.
 
 
allocatePorts(numPorts)
Returns a list of 'numPorts' port numbers that have not been given out to any other caller from the same mongo shell.
 
assert(b, msg)
 
awaitBalance(collName, dbName, timeToWait)
Waits up to one minute for the difference in chunks between the most loaded shard and least loaded shard to be 0 or 1, indicating that the collection is well balanced.
 
awaitBalancerRound(timeoutMs, mongosConnection)
Waits up to the specified timeout (with a default of 60s) for the balancer to execute one round.
 
Waits for the last oplog entry on the primary to be visible in the committed snapshop view of the oplog on *all* secondaries.
 
Blocks until all nodes agree on who the primary is.
 
awaitNoPrimary(msg, timeout)
 
awaitReplication(timeout, secondaryOpTimeType)
 
Blocks until the secondary nodes have completed recovery and their roles are known.
 
chatty(s)
 
chunkCounts(collName, dbName)
 
chunkDiff(collName, dbName)
 
compare(l, r)
 
compareOn(field)
 
connect(url, user, pass)
 
Initializes the mongo shell's connections to the mongobridge process.
 
DB(mongo, name)
 
DBCollection(mongo, db, shortName, fullName)
 
DBCommandCursor(mongo, cmdResult, batchSize)
 
DBQuery(mongo, db, collection, ns, query, fields, limit, skip, batchSize, options)
 
 
delayMessagesFrom(bridges, delay)
Configures 'this' bridge to delay forwarding requests from the 'dest' of each of the 'bridges' to 'this.dest' by the specified amount.
 
discardMessagesFrom(bridges, lossProbability)
Configures 'this' bridge to uniformly discard requests from the 'dest' of each of the 'bridges' to 'this.dest' with probability 'lossProbability'.
 
disconnect(bridges)
Disallows communication between 'this.dest' and the 'dest' of each of the 'bridges'.
 
doassert(msg, obj)
 
Walks all oplogs and ensures matching entries.
 
ensurePrimaryShard(dbName, shardName)
Helper method for setting primary shard of a database and making sure that it was successful.
 
 
gc()
 
 
 
 
 
getDB(name)
 
 
 
getNodeId(node)
 
 
getOther(one)
Find a different shard connection than the one given.
 
 
getPrimary(timeout)
Blocking call, which will wait for a primary to be elected for some pre-defined timeout and if primary is available will return a connection to it.
 
Find the connection to the primary shard for database 'dbname'.
 
Finds the _id of the primary shard for database 'dbname', e.g.
 
 
Gets the current replica set config from the specified node index.
 
getSecondaries(timeout)
 
getSecondary(timeout)
 
getShard(coll, query, includeEmpty)
 
getShardsForQuery(coll, query, includeEmpty)
Returns the shards on which documents matching a particular query reside.
 
 
initiate(cfg, initCmd, timeout)
 
isMasterStatePrompt(isMasterResponse)
 
 
 
ISODate(isoDateStr)
 
 
jsTestLog(msg)
 
 
 
Map()
 
 
Mongo(host)
 
MongoBridge(options)
Wrapper around a mongobridge process.
 
 
 
Returns list of nodes as host:port strings.
 
 
onNumShards(collName, dbName)
 
PlanCache(collection)
 
 
 
 
 
 
 
 
printShardingStatus(configDB, verbose)
 
 
QueryPlan(cursor)
 
reconnect(bridges)
Allows communication between 'this.dest' and the 'dest' of each of the 'bridges'.
 
 
Configures 'this' bridge to close existing connections and reject new connections from the 'dest' of each of the 'bridges'.
 
remove(nodeId)
 
 
Sets up a replica set.
 
ReplTest(name, ports)
 
restart(n, options, signal, wait)
Restarts a db without clearing the data directory by default.
 
Stops and restarts a config server mongod process.
 
restartMongod(n, opts, beforeRestartCallback)
Stops and restarts a shard mongod process.
 
restartMongos(n, opts)
Stops and restarts a mongos process.
 
rs()
 
 
setJsTestOption(name, value)
 
setVerboseShell(verbosity)

Set the shell verbosity.

 
sh()
 
shardColl(collName, key, split, move, dbName, waitForDelete)
 
shardCounts(collName, dbName)
 
ShardingTest(params)
Starts up a sharded cluster with the given specifications.
 
shellHelper(command, rest, shouldPrint)
 
 
 
sortDoc(doc)
 
start(n, options, restart, wait)
Starts up a server.
 
DEPRECATED Start mongod or mongos and return a Mongo() object connected to there.
 
 
startParallelShell(jsCode, port, noConnect)
 
startSet(options)
Starts each node in the replica set with the given options.
 
status(timeout)
 
stop(n, signal, opts)
Stops a particular node or nodes, specified by conn or id
 
Kills the config server mongod with index n.
 
stopMaster(signal, opts)
 
stopMongod(n, opts)
Kills the shard mongod with index n.
 
stopMongos(n, opts)
Kills the mongos with index n.
 
stopSet(signal, forRestart, opts)
Kill all members of this replica set.
 
sync()
 
tojson(x, indent, nolint)
 
tojsonObject(x, indent, nolint)
 
 
ToolTest(name, extraOptions)
 
waitForMaster(timeout)
Waits until there is a master node.
 
waitForState(node, state, timeout)
Wait for a state indicator to go to a particular state or states.
Field Detail
_bulk_api_module

Defined in: bulk_api.js.

allocatePort
Returns a port number that has not been given out to any other caller from the same mongo shell.
Defined in: servers_misc.js.

DBExplainQuery

Defined in: explain_query.js.

Explainable

Defined in: explainable.js.

Random

Defined in: utils.js.

shellAutocomplete

Defined in: utils.js.
Method Detail
_addPath(p)

Defined in: replsettest.js.
Parameters:
p

_awaitRSHostViaRSMonitor(hostAddr, desiredState, rsName, timeout)
This method is intended to aid in the writing of tests. It takes a host's address, desired state, and replicaset and waits either timeout milliseconds or until that reaches the desired state. It should be used instead of awaitRSClientHost when there is no MongoS with a connection to the replica set.
Defined in: utils.js.
Parameters:
hostAddr
desiredState
rsName
timeout

_barFormat(data, width)

Defined in: utils.js.
Parameters:
data
width

_getErrorWithCode(codeOrObj, message)

Defined in: utils.js.
Parameters:
codeOrObj
message

_readMode()

Defined in: utils.js.

_setDefaultConfigOptions(config)

Defined in: replsettest.js.
Parameters:
config

_startMongod()

Defined in: servers.js.

_useWriteCommandsDefault()

Defined in: utils.js.

_writeMode()

Defined in: utils.js.

acceptConnectionsFrom(bridges)
Configures 'this' bridge to accept new connections from the 'dest' of each of the 'bridges'.
Defined in: bridge.js.
Parameters:
{(MongoBridge|MongoBridge[])} bridges

add(config)
Adds a node to the replica set managed by this instance.
Defined in: replsettest.js.
Parameters:
config

adminCommand(cmd)

Defined in: shardingtest.js.
Parameters:
cmd

allocatePorts(numPorts)
Returns a list of 'numPorts' port numbers that have not been given out to any other caller from the same mongo shell.
Defined in: servers_misc.js.
Parameters:
numPorts

assert(b, msg)

Defined in: assert.js.
Parameters:
b
msg

awaitBalance(collName, dbName, timeToWait)
Waits up to one minute for the difference in chunks between the most loaded shard and least loaded shard to be 0 or 1, indicating that the collection is well balanced. This should only be called after creating a big enough chunk difference to trigger balancing.
Defined in: shardingtest.js.
Parameters:
collName
dbName
timeToWait

awaitBalancerRound(timeoutMs, mongosConnection)
Waits up to the specified timeout (with a default of 60s) for the balancer to execute one round. If no round has been executed, throws an error. The mongosConnection parameter is optional and allows callers to specify a connection different than the first mongos instance in the list.
Defined in: shardingtest.js.
Parameters:
timeoutMs
mongosConnection

awaitLastOpCommitted()
Waits for the last oplog entry on the primary to be visible in the committed snapshop view of the oplog on *all* secondaries. Returns last oplog entry.
Defined in: replsettest.js.

awaitNodesAgreeOnPrimary(timeout)
Blocks until all nodes agree on who the primary is.
Defined in: replsettest.js.
Parameters:
timeout

awaitNoPrimary(msg, timeout)

Defined in: replsettest.js.
Parameters:
msg
timeout

awaitReplication(timeout, secondaryOpTimeType)

Defined in: replsettest.js.
Parameters:
timeout
secondaryOpTimeType

awaitSecondaryNodes(timeout)
Blocks until the secondary nodes have completed recovery and their roles are known.
Defined in: replsettest.js.
Parameters:
timeout

chatty(s)

Defined in: utils.js.
Parameters:
s

chunkCounts(collName, dbName)

Defined in: shardingtest.js.
Parameters:
collName
dbName

chunkDiff(collName, dbName)

Defined in: shardingtest.js.
Parameters:
collName
dbName

compare(l, r)

Defined in: utils.js.
Parameters:
l
r

compareOn(field)

Defined in: utils.js.
Parameters:
field

connect(url, user, pass)

Defined in: mongo.js.
Parameters:
url
user
pass

connectToBridge()
Initializes the mongo shell's connections to the mongobridge process. Throws an error if the mongobridge process stopped running or if a connection cannot be made. The mongod or mongos process corresponding to this mongobridge process may need to connect to itself through the mongobridge process, e.g. when running the _isSelf command. This means the mongobridge process needs to be running prior to the other process. However, to avoid spurious failures during situations where the mongod or mongos process is not ready to accept connections, connections to the mongobridge process should only be made after the other process is known to be reachable: var bridge = new MongoBridge(...); var conn = MongoRunner.runMongoXX(...); assert.neq(null, conn); bridge.connectToBridge();
Defined in: bridge.js.

DB(mongo, name)

Defined in: db.js.
Parameters:
mongo
name

DBCollection(mongo, db, shortName, fullName)

Defined in: collection.js.
Parameters:
mongo
db
shortName
fullName

DBCommandCursor(mongo, cmdResult, batchSize)

Defined in: query.js.
Parameters:
mongo
cmdResult
batchSize

DBQuery(mongo, db, collection, ns, query, fields, limit, skip, batchSize, options)

Defined in: query.js.
Parameters:
mongo
db
collection
ns
query
fields
limit
skip
batchSize
options

defaultPrompt()

Defined in: utils.js.

delayMessagesFrom(bridges, delay)
Configures 'this' bridge to delay forwarding requests from the 'dest' of each of the 'bridges' to 'this.dest' by the specified amount.
Defined in: bridge.js.
Parameters:
{(MongoBridge|MongoBridge[])} bridges
{number} delay
- The delay to apply in milliseconds.

discardMessagesFrom(bridges, lossProbability)
Configures 'this' bridge to uniformly discard requests from the 'dest' of each of the 'bridges' to 'this.dest' with probability 'lossProbability'.
Defined in: bridge.js.
Parameters:
{(MongoBridge|MongoBridge[])} bridges
{number} lossProbability

disconnect(bridges)
Disallows communication between 'this.dest' and the 'dest' of each of the 'bridges'. Configures 'this' bridge to close existing connections and reject new connections from the 'dest' of each of the 'bridges'. Additionally configures each of the 'bridges' to close existing connections and reject new connections from 'this.dest'.
Defined in: bridge.js.
Parameters:
{(MongoBridge|MongoBridge[])} bridges

doassert(msg, obj)

Defined in: assert.js.
Parameters:
msg
obj

ensureOplogsMatch()
Walks all oplogs and ensures matching entries.
Defined in: replsettest.js.

ensurePrimaryShard(dbName, shardName)
Helper method for setting primary shard of a database and making sure that it was successful. Note: first mongos needs to be up.
Defined in: shardingtest.js.
Parameters:
dbName
shardName

friendlyEqual(a, b)

Defined in: utils.js.
Parameters:
a
b

gc()

Defined in: types.js.

getActiveCommands(tree)

Defined in: db.js.
Parameters:
tree

getAnother(one)

Defined in: shardingtest.js.
Parameters:
one

getChunksString(ns)

Defined in: shardingtest.js.
Parameters:
ns

getConnNames()

Defined in: shardingtest.js.

getDB(name)

Defined in: shardingtest.js.
Parameters:
name

getDBPaths()

Defined in: shardingtest.js.

getHashes(db)

Defined in: replsettest.js.
Parameters:
db

getNodeId(node)

Defined in: replsettest.js.
Parameters:
node

getNonPrimaries(dbname)

Defined in: shardingtest.js.
Parameters:
dbname

getOther(one)
Find a different shard connection than the one given.
Defined in: shardingtest.js.
Parameters:
one

getPort(n)

Defined in: replsettest.js.
Parameters:
n

getPrimary(timeout)
Blocking call, which will wait for a primary to be elected for some pre-defined timeout and if primary is available will return a connection to it. Otherwise throws an exception.
Defined in: replsettest.js.
Parameters:
timeout

getPrimaryShard(dbname)
Find the connection to the primary shard for database 'dbname'.
Defined in: shardingtest.js.
Parameters:
dbname

getPrimaryShardIdForDatabase(dbname)
Finds the _id of the primary shard for database 'dbname', e.g., 'test-rs0'
Defined in: shardingtest.js.
Parameters:
dbname

getReplSetConfig()

Defined in: replsettest.js.

getReplSetConfigFromNode(nodeId)
Gets the current replica set config from the specified node index. If no nodeId is specified, uses the primary node.
Defined in: replsettest.js.
Parameters:
nodeId

getSecondaries(timeout)

Defined in: replsettest.js.
Parameters:
timeout

getSecondary(timeout)

Defined in: replsettest.js.
Parameters:
timeout

getShard(coll, query, includeEmpty)

Defined in: shardingtest.js.
Parameters:
coll
query
includeEmpty

getShardsForQuery(coll, query, includeEmpty)
Returns the shards on which documents matching a particular query reside.
Defined in: shardingtest.js.
Parameters:
coll
query
includeEmpty

getURL()

Defined in: replsettest.js.

initiate(cfg, initCmd, timeout)

Defined in: replsettest.js.
Parameters:
cfg
initCmd
timeout

isMasterStatePrompt(isMasterResponse)

Defined in: utils.js.
Parameters:
isMasterResponse

isNumber(x)

Defined in: types.js.
Parameters:
x

isObject(x)

Defined in: types.js.
Parameters:
x

ISODate(isoDateStr)

Defined in: types.js.
Parameters:
isoDateStr

isString(x)

Defined in: types.js.
Parameters:
x

jsTestLog(msg)

Defined in: utils.js.
Parameters:
msg

jsTestName()

Defined in: utils.js.

jsTestOptions()

Defined in: utils.js.

Map()

Defined in: types.js.

MapReduceResult(db, o)

Defined in: collection.js.
Parameters:
db
o

Mongo(host)

Defined in: mongo.js.
Parameters:
host

{Proxy} MongoBridge(options)
Wrapper around a mongobridge process. Construction of a MongoBridge instance will start a new mongobridge process that listens on 'options.port' and forwards messages to 'options.dest'.
Defined in: bridge.js.
Parameters:
{Object} options
{string} options.dest
- The host:port to forward messages to.
{string} options.hostName Optional, Default: localhost
- The hostname to specify when connecting to the mongobridge process.
{number} options.port Optional, Default: allocatePort()
- The port number the mongobridge should listen on.
Returns:
{Proxy} Acts as a typical connection object to options.hostName:options.port that has additional functions exposed to shape network traffic from other processes.

MongoRunner()

Defined in: servers.js.

myPort()

Defined in: servers.js.

nodeList()
Returns list of nodes as host:port strings.
Defined in: replsettest.js.

normalize(x)

Defined in: shardingtest.js.
Parameters:
x

onNumShards(collName, dbName)

Defined in: shardingtest.js.
Parameters:
collName
dbName

PlanCache(collection)

Defined in: collection.js.
Parameters:
collection

print()

Defined in: utils.js.

printChangeLog()

Defined in: shardingtest.js.

printChunks(ns)

Defined in: shardingtest.js.
Parameters:
ns

printCollectionInfo(ns, msg)

Defined in: shardingtest.js.
Parameters:
ns
msg

printjson(x)

Defined in: types.js.
Parameters:
x

printjsononeline(x)

Defined in: types.js.
Parameters:
x

printShardingSizes(configDB)

Defined in: utils_sh.js.
Parameters:
configDB

printShardingStatus(configDB, verbose)

Defined in: utils_sh.js.
Parameters:
configDB
verbose

printStackTrace()

Defined in: utils.js.

QueryPlan(cursor)

Defined in: query.js.
Parameters:
cursor

reconnect(bridges)
Allows communication between 'this.dest' and the 'dest' of each of the 'bridges'. Configures 'this' bridge to accept new connections from the 'dest' of each of the 'bridges'. Additionally configures each of the 'bridges' to accept new connections from 'this.dest'.
Defined in: bridge.js.
Parameters:
{(MongoBridge|MongoBridge[])} bridges

reInitiate()

Defined in: replsettest.js.

rejectConnectionsFrom(bridges)
Configures 'this' bridge to close existing connections and reject new connections from the 'dest' of each of the 'bridges'.
Defined in: bridge.js.
Parameters:
{(MongoBridge|MongoBridge[])} bridges

remove(nodeId)

Defined in: replsettest.js.
Parameters:
nodeId

replSetMemberStatePrompt()

Defined in: utils.js.

ReplSetTest(opts)
Sets up a replica set. To make the set running, call #startSet, followed by #initiate (and optionally, #awaitSecondaryNodes to block till the set is fully operational). Note that some of the replica start up parameters are not passed here, but to the #startSet method.
Defined in: replsettest.js.
Parameters:
{Object|string} opts
If this value is a string, it specifies the connection string for a MongoD host to be used for recreating a ReplSetTest from. Otherwise, if it is an object, it must have the following contents: { name {string}: name of this replica set. Default: 'testReplSet' host {string}: name of the host machine. Hostname will be used if not specified. useHostName {boolean}: if true, use hostname of machine, otherwise use localhost nodes {number|Object|Array.}: number of replicas. Default: 0. Can also be an Object (or Array). Format for Object: { : replica member option Object. @see MongoRunner.runMongod : and so on... } If object has a special "rsConfig" field then those options will be used for each replica set member config options when used to initialize the replica set, or building the config with getReplSetConfig() Format for Array: An array of replica member option Object. @see MongoRunner.runMongod Note: For both formats, a special boolean property 'arbiter' can be specified to denote a member is an arbiter. Note: A special "bridgeOptions" property can be specified in both the object and array formats to configure the options for the mongobridge corresponding to that node. These options are merged with the opts.bridgeOptions options, where the node-specific options take precedence. nodeOptions {Object}: Options to apply to all nodes in the replica set. Format for Object: { cmdline-param-with-no-arg : "", param-with-arg : arg } This turns into "mongod --cmdline-param-with-no-arg --param-with-arg arg" oplogSize {number}: Default: 40 useSeedList {boolean}: Use the connection string format of this set as the replica set name (overrides the name property). Default: false keyFile {string} protocolVersion {number}: protocol version of replset used by the replset initiation. useBridge {boolean}: If true, then a mongobridge process is started for each node in the replica set. Both the replica set configuration and the connections returned by startSet() will be references to the proxied connections. Defaults to false. bridgeOptions {Object}: Options to apply to all mongobridge processes. Defaults to {}. settings {object}: Setting used in the replica set config document. Example: settings: { chainingAllowed: false, ... } } Member variables: nodes {Array.} - connection to replica set members
ReplTest(name, ports)

Defined in: servers_misc.js.
Parameters:
name
ports

restart(n, options, signal, wait)
Restarts a db without clearing the data directory by default. If the server is not stopped first, this function will not work. Option { startClean : true } forces clearing the data directory. Option { auth : Object } object that contains the auth details for admin credentials. Should contain the fields 'user' and 'pwd'
Defined in: replsettest.js.
Parameters:
{int|conn|[int|conn]} n
array or single server number (0, 1, 2, ...) or conn
options
signal
wait

restartConfigServer(n)
Stops and restarts a config server mongod process. If opts is specified, the new mongod is started using those options. Otherwise, it is started with its previous parameters. Warning: Overwrites the old cn/confign member variables.
Defined in: shardingtest.js.
Parameters:
n

restartMongod(n, opts, beforeRestartCallback)
Stops and restarts a shard mongod process. If opts is specified, the new mongod is started using those options. Otherwise, it is started with its previous parameters. The 'beforeRestartCallback' parameter is an optional function that will be run after the MongoD is stopped, but before it is restarted. The intended uses of the callback are modifications to the dbpath of the mongod that must be made while it is stopped. Warning: Overwrites the old dn/shardn member variables.
Defined in: shardingtest.js.
Parameters:
n
opts
beforeRestartCallback

restartMongos(n, opts)
Stops and restarts a mongos process. If opts is specified, the new mongos is started using those options. Otherwise, it is started with its previous parameters. Warning: Overwrites the old s (if n = 0) admin, config, and sn member variables.
Defined in: shardingtest.js.
Parameters:
n
opts

rs()

Defined in: utils.js.

runMongoProgram()

Defined in: servers.js.

setJsTestOption(name, value)

Defined in: utils.js.
Parameters:
name
value

setVerboseShell(verbosity)

Set the shell verbosity. If verbose the shell will display more information about command results.

Default is off.


Defined in: utils.js.

Parameters:
{Bool} verbosity
on / off

sh()

Defined in: utils_sh.js.

shardColl(collName, key, split, move, dbName, waitForDelete)

Defined in: shardingtest.js.
Parameters:
collName
key
split
move
dbName
waitForDelete

shardCounts(collName, dbName)

Defined in: shardingtest.js.
Parameters:
collName
dbName

ShardingTest(params)
Starts up a sharded cluster with the given specifications. The cluster will be fully operational after the execution of this constructor function. In addition to its own methods, ShardingTest inherits all the functions from the 'sh' utility with the db set as the first mongos instance in the test (i.e. s0).
Defined in: shardingtest.js.
Parameters:
{Object} params
Contains the key-value pairs for the cluster configuration. Accepted keys are: { name {string}: name for this test verbose {number}: the verbosity for the mongos chunkSize {number}: the chunk size to use as configuration for the cluster nopreallocj {boolean|number}: mongos {number|Object|Array.}: number of mongos or mongos configuration object(s)(*). @see MongoRunner.runMongos rs {Object|Array.}: replica set configuration object. Can contain: { nodes {number}: number of replica members. Defaults to 3. protocolVersion {number}: protocol version of replset used by the replset initiation. initiateTimeout {number}: timeout in milliseconds to specify to ReplSetTest.prototype.initiate(). For other options, @see ReplSetTest#start } shards {number|Object|Array.}: number of shards or shard configuration object(s)(*). @see MongoRunner.runMongod config {number|Object|Array.}: number of config server or config server configuration object(s)(*). @see MongoRunner.runMongod (*) There are two ways For multiple configuration objects. (1) Using the object format. Example: { d0: { verbose: 5 }, d1: { auth: '' }, rs2: { oplogsize: 10 }} In this format, d = mongod, s = mongos & c = config servers (2) Using the array format. Example: [{ verbose: 5 }, { auth: '' }] Note: you can only have single server shards for array format. Note: A special "bridgeOptions" property can be specified in both the object and array formats to configure the options for the mongobridge corresponding to that node. These options are merged with the params.bridgeOptions options, where the node-specific options take precedence. other: { nopreallocj: same as above rs: same as above chunkSize: same as above keyFile {string}: the location of the keyFile shardOptions {Object}: same as the shards property above. Can be used to specify options that are common all shards. configOptions {Object}: same as the config property above. Can be used to specify options that are common all config servers. mongosOptions {Object}: same as the mongos property above. Can be used to specify options that are common all mongos. enableBalancer {boolean} : if true, enable the balancer manualAddShard {boolean}: shards will not be added if true. useBridge {boolean}: If true, then a mongobridge process is started for each node in the sharded cluster. Defaults to false. bridgeOptions {Object}: Options to apply to all mongobridge processes. Defaults to {}. // replica Set only: rsOptions {Object}: same as the rs property above. Can be used to specify options that are common all replica members. useHostname {boolean}: if true, use hostname of machine, otherwise use localhost numReplicas {number}, waitForCSRSSecondaries {boolean}: if false, will not wait for the read committed view of the secondaries to catch up with the primary. Defaults to true. } } Member variables: s {Mongo} - connection to the first mongos s0, s1, ... {Mongo} - connection to different mongos rs0, rs1, ... {ReplSetTest} - test objects to replica sets shard0, shard1, ... {Mongo} - connection to shards (not available for replica sets) d0, d1, ... {Mongo} - same as shard0, shard1, ... config0, config1, ... {Mongo} - connection to config servers c0, c1, ... {Mongo} - same as config0, config1, ... configRS - If the config servers are a replset, this will contain the config ReplSetTest object
shellHelper(command, rest, shouldPrint)

Defined in: utils.js.
Parameters:
command
rest
shouldPrint

shellPrint(x)

Defined in: utils.js.
Parameters:
x

shellPrintHelper(x)

Defined in: utils.js.
Parameters:
x

sortDoc(doc)

Defined in: assert.js.
Parameters:
doc

start(n, options, restart, wait)
Starts up a server. Options are saved by default for subsequent starts. Options { remember : true } re-applies the saved options from a prior start. Options { noRemember : true } ignores the current properties. Options { appendOptions : true } appends the current options to those remembered. Options { startClean : true } clears the data directory before starting.
Defined in: replsettest.js.
Parameters:
{int|conn|[int|conn]} n
array or single server number (0, 1, 2, ...) or conn
{object} options Optional
{boolean} restart Optional
If false, the data directory will be cleared before the server starts. Default: false.
wait

startMongoProgram()
DEPRECATED Start mongod or mongos and return a Mongo() object connected to there. This function's first argument is "mongod" or "mongos" program name, \ and subsequent arguments to this function are passed as command line arguments to the program.
Defined in: servers.js.

startMongoProgramNoConnect()

Defined in: servers.js.

startParallelShell(jsCode, port, noConnect)

Defined in: servers_misc.js.
Parameters:
jsCode
port
noConnect

startSet(options)
Starts each node in the replica set with the given options.
Defined in: replsettest.js.
Parameters:
options
- The options passed to MongoRunner.runMongod

status(timeout)

Defined in: replsettest.js.
Parameters:
timeout

stop(n, signal, opts)
Stops a particular node or nodes, specified by conn or id
Defined in: replsettest.js.
Parameters:
{number|Mongo} n
the index or connection object of the replica set member to stop.
{number} signal
the signal number to use for killing
{Object} opts
@see MongoRunner.stopMongod

stopConfigServer(n, opts)
Kills the config server mongod with index n.
Defined in: shardingtest.js.
Parameters:
n
opts

stopMaster(signal, opts)

Defined in: replsettest.js.
Parameters:
signal
opts

stopMongod(n, opts)
Kills the shard mongod with index n.
Defined in: shardingtest.js.
Parameters:
n
opts

stopMongos(n, opts)
Kills the mongos with index n.
Defined in: shardingtest.js.
Parameters:
n
opts

stopSet(signal, forRestart, opts)
Kill all members of this replica set.
Defined in: replsettest.js.
Parameters:
{number} signal
The signal number to use for killing the members
{boolean} forRestart
will not cleanup data directory
{Object} opts
@see MongoRunner.stopMongod

sync()

Defined in: shardingtest.js.

tojson(x, indent, nolint)

Defined in: types.js.
Parameters:
x
indent
nolint

tojsonObject(x, indent, nolint)

Defined in: types.js.
Parameters:
x
indent
nolint

tojsononeline(x)

Defined in: types.js.
Parameters:
x

ToolTest(name, extraOptions)

Defined in: servers_misc.js.
Parameters:
name
extraOptions

waitForMaster(timeout)
Waits until there is a master node.
Defined in: replsettest.js.
Parameters:
timeout

waitForState(node, state, timeout)
Wait for a state indicator to go to a particular state or states.
Defined in: replsettest.js.
Parameters:
node
is a single node or list of nodes, by id or conn
state
is a single state or list of states
timeout

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Aug 12 2016 18:54:02 GMT-0000 (UTC)