How to query for list of properties in a documentDocumentDb: Get the first documentGetting all root propertiesQuerying for changed documents in DocumentDbHow to select all fields of a document and a new propertyCosmos DB: Querying documents properties with special characters such as “$”How to search List of name which are present in cosmos documentsHigh request-charge for very simple query in Azure Cosmos DB (SQL API)How can I select a filtered child document collection when querying a top level document in cosmos dbCosmos DB Sql how to get distinct list of items in array?Azure CosmosDB SQL Record counts
Could the museum Saturn V's be refitted for one more flight?
Why do I get negative height?
In the UK, is it possible to get a referendum by a court decision?
Why was Sir Cadogan fired?
Was the old ablative pronoun "med" or "mēd"?
What historical events would have to change in order to make 19th century "steampunk" technology possible?
Rotate ASCII Art by 45 Degrees
What is the opposite of "eschatology"?
What exactly is ineptocracy?
Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?
How many wives did king shaul have
What is required to make GPS signals available indoors?
Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?
Why was the shrink from 8″ made only to 5.25″ and not smaller (4″ or less)
What does the same-ish mean?
Solving an equation with constraints
How can a day be of 24 hours?
How does a dynamic QR code work?
Does int main() need a declaration on C++?
What do you call someone who asks many questions?
Finding the reason behind the value of the integral.
How to install cross-compiler on Ubuntu 18.04?
What is the most common color to indicate the input-field is disabled?
How can saying a song's name be a copyright violation?
How to query for list of properties in a document
DocumentDb: Get the first documentGetting all root propertiesQuerying for changed documents in DocumentDbHow to select all fields of a document and a new propertyCosmos DB: Querying documents properties with special characters such as “$”How to search List of name which are present in cosmos documentsHigh request-charge for very simple query in Azure Cosmos DB (SQL API)How can I select a filtered child document collection when querying a top level document in cosmos dbCosmos DB Sql how to get distinct list of items in array?Azure CosmosDB SQL Record counts
I will be receiving flat documents that will have slightly different schemas.
For example:
"FirstName": "Jim",
"LastName: "Bob"
And another one, that would simply have:
"FullName": "Jim Bob"
Is it possible to query the Person
collection to retrieve the list of unique properties (not the values)?
[
"FirstName",
"LastName",
"FullName"
]
azure-cosmosdb azure-cosmosdb-sqlapi
add a comment |
I will be receiving flat documents that will have slightly different schemas.
For example:
"FirstName": "Jim",
"LastName: "Bob"
And another one, that would simply have:
"FullName": "Jim Bob"
Is it possible to query the Person
collection to retrieve the list of unique properties (not the values)?
[
"FirstName",
"LastName",
"FullName"
]
azure-cosmosdb azure-cosmosdb-sqlapi
add a comment |
I will be receiving flat documents that will have slightly different schemas.
For example:
"FirstName": "Jim",
"LastName: "Bob"
And another one, that would simply have:
"FullName": "Jim Bob"
Is it possible to query the Person
collection to retrieve the list of unique properties (not the values)?
[
"FirstName",
"LastName",
"FullName"
]
azure-cosmosdb azure-cosmosdb-sqlapi
I will be receiving flat documents that will have slightly different schemas.
For example:
"FirstName": "Jim",
"LastName: "Bob"
And another one, that would simply have:
"FullName": "Jim Bob"
Is it possible to query the Person
collection to retrieve the list of unique properties (not the values)?
[
"FirstName",
"LastName",
"FullName"
]
azure-cosmosdb azure-cosmosdb-sqlapi
azure-cosmosdb azure-cosmosdb-sqlapi
edited Mar 7 at 21:44
Andrés Nava - .NET
asked Mar 7 at 21:20
Andrés Nava - .NETAndrés Nava - .NET
7,42833572
7,42833572
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
According to my research, it is not supported in cosmos db query syntax so far. You could refer to this similar feedback and adopt the suggestions from cosmos db team.
Also, I think you could get all the names of properties by below coding workaround.
Create and init a hashmap.
Query the documents and get the results array.
Loop the array and convert every json to map.
Push the elements into initial hashmap to make sure the list of properties is unique.
I was hoping that there was a built-in feature to accomplish this. Since there isn't, your answer seems to be the best way to accomplish this.
– Andrés Nava - .NET
Mar 11 at 15:25
Hi Jay. Please try to refrain from adding "hope this helps" and other conversational items to your posts. Stack Overflow is intended to be a bit more like documentation than a chat room, and succinctness is valued! Thank you.
– halfer
Mar 16 at 9:17
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052969%2fhow-to-query-for-list-of-properties-in-a-document%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
According to my research, it is not supported in cosmos db query syntax so far. You could refer to this similar feedback and adopt the suggestions from cosmos db team.
Also, I think you could get all the names of properties by below coding workaround.
Create and init a hashmap.
Query the documents and get the results array.
Loop the array and convert every json to map.
Push the elements into initial hashmap to make sure the list of properties is unique.
I was hoping that there was a built-in feature to accomplish this. Since there isn't, your answer seems to be the best way to accomplish this.
– Andrés Nava - .NET
Mar 11 at 15:25
Hi Jay. Please try to refrain from adding "hope this helps" and other conversational items to your posts. Stack Overflow is intended to be a bit more like documentation than a chat room, and succinctness is valued! Thank you.
– halfer
Mar 16 at 9:17
add a comment |
According to my research, it is not supported in cosmos db query syntax so far. You could refer to this similar feedback and adopt the suggestions from cosmos db team.
Also, I think you could get all the names of properties by below coding workaround.
Create and init a hashmap.
Query the documents and get the results array.
Loop the array and convert every json to map.
Push the elements into initial hashmap to make sure the list of properties is unique.
I was hoping that there was a built-in feature to accomplish this. Since there isn't, your answer seems to be the best way to accomplish this.
– Andrés Nava - .NET
Mar 11 at 15:25
Hi Jay. Please try to refrain from adding "hope this helps" and other conversational items to your posts. Stack Overflow is intended to be a bit more like documentation than a chat room, and succinctness is valued! Thank you.
– halfer
Mar 16 at 9:17
add a comment |
According to my research, it is not supported in cosmos db query syntax so far. You could refer to this similar feedback and adopt the suggestions from cosmos db team.
Also, I think you could get all the names of properties by below coding workaround.
Create and init a hashmap.
Query the documents and get the results array.
Loop the array and convert every json to map.
Push the elements into initial hashmap to make sure the list of properties is unique.
According to my research, it is not supported in cosmos db query syntax so far. You could refer to this similar feedback and adopt the suggestions from cosmos db team.
Also, I think you could get all the names of properties by below coding workaround.
Create and init a hashmap.
Query the documents and get the results array.
Loop the array and convert every json to map.
Push the elements into initial hashmap to make sure the list of properties is unique.
edited Mar 16 at 9:16
halfer
14.7k759116
14.7k759116
answered Mar 8 at 1:31
Jay GongJay Gong
9,6711614
9,6711614
I was hoping that there was a built-in feature to accomplish this. Since there isn't, your answer seems to be the best way to accomplish this.
– Andrés Nava - .NET
Mar 11 at 15:25
Hi Jay. Please try to refrain from adding "hope this helps" and other conversational items to your posts. Stack Overflow is intended to be a bit more like documentation than a chat room, and succinctness is valued! Thank you.
– halfer
Mar 16 at 9:17
add a comment |
I was hoping that there was a built-in feature to accomplish this. Since there isn't, your answer seems to be the best way to accomplish this.
– Andrés Nava - .NET
Mar 11 at 15:25
Hi Jay. Please try to refrain from adding "hope this helps" and other conversational items to your posts. Stack Overflow is intended to be a bit more like documentation than a chat room, and succinctness is valued! Thank you.
– halfer
Mar 16 at 9:17
I was hoping that there was a built-in feature to accomplish this. Since there isn't, your answer seems to be the best way to accomplish this.
– Andrés Nava - .NET
Mar 11 at 15:25
I was hoping that there was a built-in feature to accomplish this. Since there isn't, your answer seems to be the best way to accomplish this.
– Andrés Nava - .NET
Mar 11 at 15:25
Hi Jay. Please try to refrain from adding "hope this helps" and other conversational items to your posts. Stack Overflow is intended to be a bit more like documentation than a chat room, and succinctness is valued! Thank you.
– halfer
Mar 16 at 9:17
Hi Jay. Please try to refrain from adding "hope this helps" and other conversational items to your posts. Stack Overflow is intended to be a bit more like documentation than a chat room, and succinctness is valued! Thank you.
– halfer
Mar 16 at 9:17
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052969%2fhow-to-query-for-list-of-properties-in-a-document%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown