mongodb - Map not compiled -


i have collection of following :

{   "_id" : objectid("51dfb7abe4b02f15ee93a7c7"),   "date_created" : "2013-7-12  13:25:5",   "referrer_id" : 13,   "role_name" : "physician",   "status_id" : "1",   "demographics" : {     "date_created" : "2013-7-12  13:25:5",     "first_name" : "jjjjkk",     "last_name" : "jjjjkkjjjjkkjjjjkk",     "birthdate" : "11-07-1980"   } } 

i creating following map function:

"map" : "function map(){emit(this._id,{demographics:{first_name\":this.demographics.first_name,middle_name\":this.demographics.middle_name,last_name\":this.demographics.last_name}});" 

as per documentation , getting error

"errmsg" : "exception: couldn't compile code for: `_map`" 

please try:

var map = function(){   emit(this._id, {     demographics:{       first_name:  this.demographics.first_name,       middle_name: this.demographics.middle_name,       last_name:   this.demographics.last_name     }   }); } 

inline:

var map = function(){emit(this._id, {demographics:{first_name: this.demographics.first_name, middle_name: this.demographics.middle_name, last_name: this.demographics.last_name } }); } 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -