Adding a field to a document using upsert


I have a collection members that i want to update. The document contains only a field telephonenumber and id.

I have several telephone numbers

I want to add an extra field names and i am using a method to do that

‘updatenumber’: function(tn,names){

                 telephoneNumber: tn
              }, {
                 $set: {
                    telephoneNumber: tn,
              }, {
                  upsert: true

Although tn and names contain data from clientside, the field names is not added. Why is that?.