p is the alias for parents collection within JSON. CosmosDB is like document database and f.parents will point to parents JSON collection within each Families JSON. That is aliased as p and used to retrieve the values within it.
The join action can be mimicked using subqueries but keep in mind that it would be extremely costlier from performance perspective (RUs consumed ill be much higher) Unlike relational queries, in NoSQL systems like Cosmos you always store related entities together so that they will become part of the same document or keep them separate but partitioned based on good shared partition key. Keep in mind that Cosmos DB is schema agnostic. so try to store them together as embedded documents or partition using a properly chosen shared partition key. More details can be found in the below links docs.microsoft.com/en-us/azure/cosmos-db/sql/modeling-data docs.microsoft.com/en-us/azure/cosmos-db/partitioning-overview docs.microsoft.com/en-us/azure/cosmos-db/sql/how-to-model-partition-example
Imagine a family that doesnt have a pet. Then what. The whole family will disappear from the result. Why only show an example of the most simple solution that would almost never happen?
Because the topic is on basics of how join works in SQL API and we are not dealing with any advanced topics scenarios here. We can only learn 3,4,5 etc after completing 1,2 :)
Thanks! Do you hace a tip for queries across two or more documents?
You're welcome
Can you elaborate what you want to retrieve from two or more document?
Awesome
Thanks Dibya
I hav doubt sir
In normal sql we mention bith tables , but i am not able yo get where is P table and how it is joined directly
p is the alias for parents collection within JSON.
CosmosDB is like document database and f.parents will point to parents JSON collection within each Families JSON. That is aliased as p and used to retrieve the values within it.
Need to know how to use joins in Azure Synapse Cosmos DB
Its explained here
learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/join
Which library is good to integrate cosmosdb gremlin api with java?
Sorry not much idea on that. Have not worked with Gremlin API yet
Hi is there a way to select all values in the parent where the child contains the inputted value
"Child has inputted value" means?
@@dataplatformcentral3036 like select * from families f where f.children.givename = 'Alex'? ('Alex' is the parameter value)
how to join/query with different container?
The join action can be mimicked using subqueries but keep in mind that it would be extremely costlier from performance perspective (RUs consumed ill be much higher)
Unlike relational queries, in NoSQL systems like Cosmos you always store related entities together so that they will become part of the same document or keep them separate but partitioned based on good shared partition key. Keep in mind that Cosmos DB is schema agnostic.
so try to store them together as embedded documents or partition using a properly chosen shared partition key.
More details can be found in the below links
docs.microsoft.com/en-us/azure/cosmos-db/sql/modeling-data
docs.microsoft.com/en-us/azure/cosmos-db/partitioning-overview
docs.microsoft.com/en-us/azure/cosmos-db/sql/how-to-model-partition-example
Imagine a family that doesnt have a pet. Then what. The whole family will disappear from the result. Why only show an example of the most simple solution that would almost never happen?
Because the topic is on basics of how join works in SQL API and we are not dealing with any advanced topics scenarios here. We can only learn 3,4,5 etc after completing 1,2 :)