[SOLVED] Sync and Watch Event Address First time does not trigger beforeSave

i dont know if it is feature or i have wrong code but when i start Sync and watch event address for first time beforeSave does not trigger but when i edit the data from dashboard manually it triggered

i have simple code

Moralis.Cloud.beforeSave("PolygonMarketTransaction", async (request) => {
    const logger = Moralis.Cloud.getLogger();
    logger.info(`New Transaction Found At Polygon Tx ${request.object.get('transaction_hash')}`)


you mean that when you do a historical sync it does not trigger beforeSave?

yes, the feature what i mean is Sync and Watch Contract Events

yes, just wanted to clarify if you mean for historical or for new events, because you have a checkbox to enable or not historical events sync

Sync_historical (Optional) was checked

yes, I think that for historical sync events that beforeSave will not trigger, and you’ll have to run a separate job if you want to process those events.

so i need to create code to loop current data and save again so beforeSave triggered ? okay

or loop data and run the code that you would run on beforeSave

okay looks like moralis insert all historical data straight to mongodb thats why beforeSave does not trigger or something like that