Please Help with meteor method-update

Hi,
Using meteor autoform method-update
//HTML CODE

Competency Check

<h2>Linked Event</h2>

{{#autoForm
doc=this
id="updateLearnerForm"
collection="colLearner"
type="method-update"
meteormethod=“updateLesson”}}

{{> afQuickField name=‘cStudent’}}

{{> afQuickField name=‘dtCertifiedDate’}}

{{> afQuickField name=‘cCertificationArchieved’}}


Submit
Reset
{{/autoForm}}

Back

//SERVER
Meteor.methods({

updateLesson: function (doc,doc_id) {
console.log(doc) 
console.log(doc_id) 

console.log(doc.cStudent)
colLearner.update({_id: doc_id}, doc); },

});

console.log(doc._id) show my parameter id, whereas, i want to update the ID of the selected dropdown box.

My problem is to pass the dropdown box value colLearner.update({_id: doc.cStudent}, doc);

console.log(doc.cStudent) is undefined

if i hard code the id ~~ colLearner.update({_id: ‘rNrLGPTyK8Kx7MT5d’, doc);

It works****

This is because the method-update autoform type send not the doc but the modifier.

ie {$set: {field1: value}}

Check out the docs:

method-update

Will call the server method with the name you specify in the meteormethod attribute.

There are two possible ways your method can be called.

By default, your method will be called with two arguments:

modifier: the modifier object generated from the form valuesdocumentId: the _id of the document being updatedIf you set singleMethodArgument=true as a form attribute, your method will be called with a single object argument with _id and modifier properties. You should do this if using the mdg:validated-method package.

You may optionally specify a DDP Connection in the ddp attribute. If you do, the method will be called using the DDP connection provided.

The method is not called until modifier is valid on the client.

You must call check() in the method or perform your own validation since a user could bypass the client side validation. Using the mdg:validated-method package is recommended.

Thank you for your prompt reply!

Am new to meteor.

So, does that mean i can’t get the value of my ‘cStudent’ from the autofom?

Cause it works when i hard code cStudent value…

colLearner.update(‘L3Qrvo2ccRvR2bbbL’, modifier);