Jump to content
We've recently updated our Privacy Statement, available here ×

nithyanand11

Members
  • Posts

    17
  • Joined

  • Last visited

Community Answers

  1. nithyanand11's post in objectid in multi-select input control was marked as the answer   
    Try with objectId.value() option
    Ex:
    {
     'collectionName' : 'user',
      mapReduce : {
        map : 'function () {
                             emit (this._id,{ id : this._id.valueOf(), lastname:this["last-name"]});
                            }',
        reduce : 'function (key, values) {
                      var allDetails = [];
                      var user = { id: null, lastname : null};
                      for( var index = 0; index < values.length; index++)
                      {
                        user.lastname = values[index].lastname;
                        user.id = values[index].id;
                        allDetails.push(user);
                        user = { lastname : null};
                      }
                       return {list : allDetails}
                   }',
        out : 'list'
      }
    }
     
     
×
×
  • Create New...