How to use MapReduce function

runCommand is a MongoDB cli method. You probably want to use collection.mapReduce instead.