Help with Updating a collection after sending email

Hi everyone,

Am trying to update my collection after sending email.

It happens that before sending the mail, i need to enter a quote number and after sending the mail i want to update my collection to store the inserted quote number.

I tried using collectionName.update(doc); and am getting the error bellow:(Cannot read _id of undefined).

Exception while invoking method ‘clicksend’ TypeError
: Cannot read property 'id’ of undefined
I20160310-17:23:22.502(2)? at [object Object].doValidate (packages/aldeed_co
I20160310-17:23:22.502(2)? at [object Object].Mongo.Collection.(anonymous fu
nction) [as update] (packages/aldeed_collection2/packages/aldeed_collection2.js:
I20160310-17:23:22.503(2)? at [object Object].Meteor.methods.clicksend (serv
I20160310-17:23:22.504(2)? at maybeAuditArgumentChecks (livedata_server.js:1
I20160310-17:23:22.505(2)? at livedata_server.js:708:19
I20160310-17:23:22.505(2)? at [object Object].
.extend.withValue (packages/m
I20160310-17:23:22.506(2)? at livedata_server.js:706:40
I20160310-17:23:22.507(2)? at [object Object]._.extend.withValue (packages/m
I20160310-17:23:22.507(2)? at livedata_server.js:704:46
I20160310-17:23:22.508(2)? at tryCallTwo (C:\Users\ar19870708ar\AppData\Loca

Hm, it looks like doc in your code may be undefined. Unless that error is coming from a different line of code… or perhaps you have a nested document that collections2 is trying to validate? I think you need to provide more details or better: a github repo that reproduces this error.