Custom - Map Reduce

/custom/mapreduce/{inputcollection}/{map}/{reduce}/{query}

Runs a mongodb map reduce job immediately and only once.

Authentication

Required, see Auth - Login

Arguments

inputcollection (required)
The input collection you want to run the map reduce job on. Can be DOC_METADATA for the documents collection or another custom map reduce results collection.

map (required)
The mongodb map to run.

reduce (required)
The mongodb reduce to run.

query (required)
The query to run on the input collection, the community ids will be added to whatever query gets submitted.

Example

http://infinite.ikanow.com/api/custom/mapreduce/DOC_METADATA/function(){ emit(this.source,{count:1})}/function(key,vals){var result = {count:0}; vals.forEach(function(val){result.count += val.count;}); return result;}/{mediaType:"Video"}

Example Response
{"response":{"action":"Custom Map Reduce Run","success":true,"message":"Map Reduce ran successfully","time":2413},"data":"[]"}
Error Response
{"response":{"action":"Custom Map Reduce Run","success":false,"message":"error running map reduce","time":285}}