I am new to mongodb. I am trying to pass parameter to mapreduce but it gives error as following, Setting up the file resolver... com.mongodb.util.JSONParseException: { 'collectionName' : 'range', mapReduce : { map : 'function () { if(this.user == {'select':null}){ emit (this._id,{userid:this.user.valueOf()}); } For some reason the parameter is returned as null. My map function is as follows,map : 'function () { if(this.user == $P{select}) { emit (this._id,{userid:this.user.valueOf()}); } }',Can anyone please point out my mistake?