Server Policies

How to create a Server Policy: -

A server policy is a piece of code that gets executed before or after when some data gets created / updated / deleted / queried in collection.

In order to create a Server Policy, follow these steps: -

  1. On navigation, under Policies go to Server Policies. You will see a list of all the server policies if any.

  2. Click on ‘settings icon’ on top left corner and then click ‘new’.

  3. A form appears where you have to provide the following details: -

  4. Name - name of the server policy.

  5. Collection – name of the collection, server policy gets executed when data is saved in this collection.

  6. Active – Check / Uncheck if ready / not ready to used.

  7. Execution Time: -

  8. PRE – Execute before the data gets created / updated / deleted / queried.

  9. POST– Execute after the data gets created / updated / deleted / queried.

  10. Action: -

  11. Create - Executed when data gets created.

  12. Update - Executed when data gets updated.

  13. Delete - Executed when data gets deleted.

  14. Query - Executed when data gets queried.

  15. Order – In what order to execute the server policy.

  16. Script – The code for doing operations(logic).

Last updated