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: -
On navigation, under Policies go to Server Policies. You will see a list of all the server policies if any.
Click on ‘settings icon’ on top left corner and then click ‘new’.
A form appears where you have to provide the following details: -
Name - name of the server policy.
Collection – name of the collection, server policy gets executed when data is saved in this collection.
Active – Check / Uncheck if ready / not ready to used.
Execution Time: -
PRE – Execute before the data gets created / updated / deleted / queried.
POST– Execute after the data gets created / updated / deleted / queried.
Action: -
Create - Executed when data gets created.
Update - Executed when data gets updated.
Delete - Executed when data gets deleted.
Query - Executed when data gets queried.
Order – In what order to execute the server policy.
Script – The code for doing operations(logic).
Last updated