DP-420 · Question #62
You are part of a development team and your team creates a set of aggregate metadata items that are needed to be changed anytime, once you successfully update or create an item within your…
The correct answer is D. Post-trigger. A post-trigger runs its logic after the item has been successfully updated or created. At this point, you can update the aggregate metadata items. Option A is incorrect. A user-defined function is used only within the context of a SQL query. Option B is incorrect. A…
Question
You are part of a development team and your team creates a set of aggregate metadata items that are needed to be changed anytime, once you successfully update or create an item within your container. Which of the following server-side programming constructs would you use for this task?
Options
- AUser-defined function
- BSystem-defined function
- CPre-trigger
- DPost-trigger
How the community answered
(54 responses)- A7% (4)
- B4% (2)
- C13% (7)
- D76% (41)
Explanation
A post-trigger runs its logic after the item has been successfully updated or created. At this point, you can update the aggregate metadata items. Option A is incorrect. A user-defined function is used only within the context of a SQL query. Option B is incorrect. A system-defined function can not be used in this scenario. Option C is incorrect. A pre-trigger will run its logic too early before the item gets successfully created or updated. Option D is correct. A post-trigger runs its logic after the item has been successfully updated or https://docs.microsoft.com/en-us/azure/cosmos-db/sql/how-to-write-stored-procedures-triggers-
Topics
Community Discussion
No community discussion yet for this question.