Sep 24, 2018

Azure Cosmos Db tips (SQL)

https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-sql-query
Clause FROM refers to Collection of something.
If you deal with only one collection you can replace it with special keyword:

Root

; like this:

SELECT
Root.id,
Root.description,
Root.tags,
Root.foodGroup,
Root.manufacturerName,
Root.version
FROM Root
WHERE (Root.manufacturerName = "The Coca-Cola Company" AND Root.version > 0)


Here is good practical explanation in approaching the document design vs relational design.

https://docs.microsoft.com/en-us/azure/cosmos-db/modeling-data

When to embed and when not, or when to normalize and when keep stuff denormalized.

No comments:

Post a Comment