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













1















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"
]









share|improve this question




























    1















    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"
    ]









    share|improve this question


























      1












      1








      1








      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"
      ]









      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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






















          1 Answer
          1






          active

          oldest

          votes


















          1














          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.



          1. Create and init a hashmap.


          2. Query the documents and get the results array.


          3. Loop the array and convert every json to map.


          4. Push the elements into initial hashmap to make sure the list of properties is unique.






          share|improve this answer

























          • 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












          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
          );



          );













          draft saved

          draft discarded


















          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









          1














          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.



          1. Create and init a hashmap.


          2. Query the documents and get the results array.


          3. Loop the array and convert every json to map.


          4. Push the elements into initial hashmap to make sure the list of properties is unique.






          share|improve this answer

























          • 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
















          1














          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.



          1. Create and init a hashmap.


          2. Query the documents and get the results array.


          3. Loop the array and convert every json to map.


          4. Push the elements into initial hashmap to make sure the list of properties is unique.






          share|improve this answer

























          • 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














          1












          1








          1







          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.



          1. Create and init a hashmap.


          2. Query the documents and get the results array.


          3. Loop the array and convert every json to map.


          4. Push the elements into initial hashmap to make sure the list of properties is unique.






          share|improve this answer















          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.



          1. Create and init a hashmap.


          2. Query the documents and get the results array.


          3. Loop the array and convert every json to map.


          4. Push the elements into initial hashmap to make sure the list of properties is unique.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          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


















          • 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




















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved