-
Notifications
You must be signed in to change notification settings - Fork 0
Sandbox
Documentation of the sandbox in which the map and reduce scripts are executed.
Keep in mind that you don't have access to Node.js globals like e.g. require, process or console and that the
documents in the sandbox are frozen, so no change on the database contents is possible by the map and reduce
scripts.
- emit(item)
-
push an item to the result array
-
forEachDocumentCallback :
function
Kind: global class
-
api
- .forEachDocument(callback)
-
.getDocument(id) ⇒
object -
.getProp(document, property) ⇒
* -
.mqttWildcard(id, pattern) ⇒
array|null
executes a provided function once for each document. Mind that using this function inside a map script can result in O(n²) complexity and could ruin view composition performance. If you need it you should instead use it in the reduce script.
Kind: static method of api
| Param | Type |
|---|---|
| callback | forEachDocumentCallback |
get a document by id
Kind: static method of api
Returns: object - the document
| Param | Type | Description |
|---|---|---|
| id | string |
a document id |
get a properties value
Kind: static method of api
Returns: * - the properties value or undefined
See: obj-ease documentation
| Param | Type |
|---|---|
| document | object |
| property | string |
match a string against a MQTT wildcard pattern
Kind: static method of api
See: mqtt-wildcard documentation
| Param | Type |
|---|---|
| id | string |
| pattern | string |
push an item to the result array
Kind: global function
| Param | Type |
|---|---|
| item | * |
Kind: global typedef
| Param | Type | Description |
|---|---|---|
| id | string |
the id of the current document |
mqttDB copyright (c) 2017 Sebastian Raff. MIT License