title: Java - How to specify the order that Firestore retrieves field names?
body: <p>I'm trying to retrieve all field names from a document (the document name is the userID) under a collection called &quot;taskboards&quot;. I want Firestore to retrieve these field names in a specific order but I don't know how.</p>
  <p>Here is the following code:</p>
  <pre><code>userID = fAuth.getCurrentUser().getUid();
  DocumentReference userTaskboardRef = fStore.collection(&quot;taskboards&quot;).document(userID)
  
  userTaskboardRef.get().addOnCompleteListener(new OnCompleteListener&lt;DocumentSnapshot&gt;() {
      @Override
      public void onComplete(@NonNull Task&lt;DocumentSnapshot&gt; task) {
          if(task.isSuccessful()){
  
              List&lt;String&gt; columnsList = new ArrayList&lt;&gt;();
  
              Map&lt;String, Object&gt; map = task.getResult().getData();
              for(Map.Entry&lt;String, Object&gt; entry : map.entrySet()){
                  columnsList.add(entry.getKey());
                  Log.d(&quot;TAG&quot;, entry.getKey());
                  Log.d(&quot;TAG&quot;, entry.getValue().toString());
  
              }
  </code></pre>
  <p>For example:</p>
  <p>I would like Firestore to retrieve the following field names in the order &quot;To Do, Doing, Done&quot;. Here is a picture of how the field names are stored in my Firestore.</p>
  <p><img src="https://i.stack.imgur.com/h8jI1.png" alt="enter image description here" /></p>
  <p>The above code works and retrieves the field names but it retrieves them in the order &quot;Doing, To Do, Done&quot;. Here is a picture of TAG showing the order.</p>
  <p><img src="https://i.stack.imgur.com/Atmuo.png" alt="enter image description here" /></p>
  <p>I'm quite new to Android Studio so can anybody help me out? Is it even possible to specify the order in which the field names are retrieved?</p>