[SOLVED] How not to save to the database in beforesave

https://docs.moralis.io/moralis-server/cloud-code/webhooks#beforesave-webhooks

To respond to a beforeSave request, send a JSON object with the key error or success set.

By returning an error, you will cancel the save request and the object will not be stored in Moralis.

How do I respond to a ā€œbeforeSaveā€ request?? This pice of documentation is so badly written or Iā€™m a dumbass not understanding how should I cancel the save to database.

return {key: 'error'}. | { error: true } doesnt seem t work

did you try with throw "Error"; ?

Well that one seem to work :slight_smile: