I am using Azure CosmosDB, the model contains Id, and creationTime properties. What I am trying to do is count entries within time interval. I looked how to achieve it using LINQ but could not find a solution. What I used than is SQL. This is what I tried: Bare in mind the values i showed are for display purposes.
Tag: azure-cosmosdb
Select * Except particular properties in Cosmos DB with SQL API
Consider the following, I have a document that looks something like this: I want to get everything from the document EXCEPT $metadata and $version The obvious solution would be to: However, my document may expand dynamically, hence why the above is suboptimal. I therefore figured that it may be better to exclude just $metadata and $version. I looked at different
How to write a JavaScript stored procedure in Azure Cosmo DB to return data from SQL API
I’m trying to create a Cosmo DB stored procedure to return the results of a relatively simple SQL statement. If it were purely SQL I would be fine but since I know nothing about JavaScript I’m struggling mightily. Any help would be very much appreciated. Here is the SQL query: Answer You can try something like this: By the way,
Cosmos db sql query for search in array
I have a document structure like below and I try to implement searching for user by fields author and partNames, so user can do query like SELECT * FROM c WHERE CONTAINS(c.author, ‘John’) and user will get in result the id=1 document because the name of author was John. The next step is to allow user ask for document by
How to use variables in SQL in an Azure stored procedure
I need have a stored procedure that runs once per day, doing some metric calculations on data collected that day. I’m going to get a datetime that is equivalent to the last time the procedure was run (…