Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MapReduceOptions<T, K, R>

Type Parameters

  • T

  • K

  • R

Hierarchy

  • MapReduceOptions

Index

Properties

map: string | Function
query?: any

query filter object.

sort?: any

sort input objects using this key

limit?: number

max number of documents

keeptemp?: boolean

keep temporary data default: false

scope?: any

scope variables exposed to map/reduce/finalize during execution

jsMode?: boolean

it is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X default: false

verbose?: boolean

provide statistics on job execution time. default: false

readPreference?: string
out?: { inline?: number; replace?: string; reduce?: string; merge?: string }

sets the output target for the map reduce job. default: {inline: 1}

Type declaration

  • Optional inline?: number

    the results are returned in an array

  • Optional replace?: string

    {replace: 'collectionName'} add the results to collectionName: the results replace the collection

  • Optional reduce?: string

    {reduce: 'collectionName'} add the results to collectionName: if dups are detected, uses the reducer / finalize functions

  • Optional merge?: string

    {merge: 'collectionName'} add the results to collectionName: if dups exist the new docs overwrite the old

Methods

  • reduce(key: K, vals: T[]): R
  • Parameters

    • key: K
    • vals: T[]

    Returns R

  • finalize(key: K, val: R): R
  • finalize function

    Parameters

    • key: K
    • val: R

    Returns R

Generated using TypeDoc