From the course: Azure Cosmos DB: SQL API Deep Dive
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Solution: JavaScript programming
From the course: Azure Cosmos DB: SQL API Deep Dive
Solution: JavaScript programming
(upbeat music) - [Instructor] In this challenge, you are asked to create a programmatic construct that could expand to SQL query language so that your company can quickly implement a 20% overhead without changing existing data. To solve this problem, I created a user-defined function or UDF. I then implemented some simple JavaScript logic to manipulate the number that is passed into the function and return the result. The logic I implemented is shown right here on the slide. Finally, I invoke the UDF in a query. I call in the function using the UDF dot function name syntax shown here. We will look at this syntax a little bit more in example. Let's go into the Azure portal and find our Azure Cosmos DB resource. Once we click the resource, we'll be directed to the resource blade. From here, we can select the data explorer to return and manage our JavaScript code. We're going to go into our database and then our collection…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.