KeystoneJS, tracking updatedBy/updatedAt -


been pulling hair, google tells me nothing. can't life of me understand how intend 'track' work.

from documentation, assumed straight forward this:

truth.add({     title: {          type: types.textarea,          required: true      }     track: {         updatedby: true     } }); 

however, above solution renders this:

error: fields must specified type function 

all want model store last updated item. not how 'track' intended work? missing...

you should define in list schema rather model fields.

you can either set track: true enable meta fields or object specific ones.

var truth = new keystone.list('truth', {     track: true // enables field     track: {updatedby: true} // enables updatedby field }); 

these appear @ bottom of item page.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -