-
Notifications
You must be signed in to change notification settings - Fork 92
Write operations
agirbal edited this page Oct 4, 2011
·
2 revisions
The browser can randomize values within a document. This is useful for example in case you want to insert many documents containing a field with a randomized value. In order to use this feature, replace the expected value with a sub-document of following form:
- 1st key should be "__rand: type", where type is a string representing the type. Currently "int" and "str" are supported.
- "int" type: use field "min" and "max" to define the bounds. e.g. {__rand: "int", min: 0, max: 1000}
- "str" type: use field "len" to define the string length. e.g. {__rand: "str", len: 10}