You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hostname of the machine mongod is running on (defaults to localhost).
username
The username to use when authenticating to mongod (only use if running with auth).
password
The password to use when authenticating to mongod (only use if running with auth).
db
The database to authenticate to (only necessary if running with auth).
ops
A list of objects describing the operations to run (documented below).
parallel
The number of threads to run (defaults to single thread).
seconds
The amount of time to run the tests for (defaults to one second).
hideResults
Prevents results from each operation executed from being logged. Default value is true. Overridden by setting showResult on a specific operation.
handleErrors
Prevents a thread from stopping on error. Default value is false. Overridden by setting handleError on a specific operation.
hideErrors
Prevents errors from being logged. Default value is false. Overridden by setting showError for a specific operation.
throwGLE
Causes benchRun to actually throw an exception on errors in updates/inserts/deletes rather than handling them. Default value is false to have benchRun to handle the errors itself. throwGLE can also be set on specific operations.
Operation Options
ns
The namespace of the collection you are running the operation on, should be of the form "db.collection".
op
The type of operation can be "findOne", "find", "insert", "update", "remove", "createIndex", "dropIndex" or "command".
query
The query object to use when querying or updating documents.
update
The update object (same as 2nd argument of update() function).
doc
The document to insert into the database (only for insert and remove).
safe
boolean specifies whether to use safe writes (only for update and insert).
delay
integer specifies the time to wait between executing the operation.
skip
Only applies to find operations. integer specifies the number of documents to skip in a query.
limit
Only applies to find operations. integer specifies the number of elements a query should return.
batchSize
Only applies to find operations. integer specifies the number of elements the returned cursor should cache.
filter
Only applies to find operations. Document specifies which fields should be returned.
expected
Only applies to find operations. integer specifies the expected number of elements returned. If the count is not as expected the operation will throw an error. Turning on the handleErrors option allows benchRun to continue if the count was not as expected.
multi
boolean specifies whether or not the update or delete should apply to multiple documents. Default value is false.
upsert
boolean specifies whether or not an update operation should be run as an upsert. Default value is false.
key
Only works for and is required by the createIndex and dropIndex operations. The definition for the index to create or drop.
showResult
boolean specifies whether to log the result of each call of the operation.
Dynamic Operators
{ "#RAND_INT" : [ min , max , <multiplier> ] }
[ 0 , 10 , 4 ] would produce random numbers between 0 and 10 and then multiply by 4.
{ "#RAND_STRING" : [ length ] }
[ 3 ] would produce a string of 3 random characters.
Dynamic operators generate random strings, random ints, etc but don't work in second level objects, just main level.
This is fine:
var complexDoc3 = { info: "#RAND_STRING": [30] } }
This is only going to insert a value called "#RAND_STRING" with an array as a key: