Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — Question 48
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account.
You need to write a SQL query that will return multiple items. The solution must meet the following requirements:
• For each item returned, include the current Coordinated Universal Time (UTC) date and time, formatted as an ISO 8601 string.
• Minimize development effort.
What should you use?
Answer options
- A. a user-defined function
- B. GetCurrentTimestamp()
- C. GetCurrentDateTime()
- D. DateTimePart()
Correct answer: C
Explanation
The correct answer is C, GetCurrentDateTime(), as it directly retrieves the current date and time in the required format with minimal coding effort. Option A, a user-defined function, would involve more development work than necessary, while options B and D do not provide the required ISO 8601 format directly and are less suitable for this task.