title: In Parse, do I need to unpin an object first if I want to sync it with the cloud?
body: <p>Unfortunately, the <a href="https://parse.com/docs/android/guide#local-datastore-pinning" rel="nofollow">official Parse documentation</a> regarding the matter is very unclear. It tells that "<em>When an object is pinned, every time you update it by fetching or saving new data, the copy in the local datastore will be updated automatically. You don't need to worry about it at all.</em>", so from what I can understand it means that if I do this</p>
  
  <pre><code>List&lt;GameScore&gt; list;
  // ...
  ParseObject.pinAllInBackground(list);
  GameScore.saveAllInBackground(list);
  </code></pre>
  
  <p>and then I do this</p>
  
  <pre><code>ParseQuery.getQuery(GameScore.class).findInBackground(new FindCallback&lt;GameScore&gt;() {
      @Override
      public void done(final List&lt;GameScore&gt; objects, ParseException e) {
          // show them ...
      }
  );
  </code></pre>
  
  <p>my locally stored pinned data should update itself.</p>
  
  <p>However, just <a href="https://parse.com/docs/android/guide#local-datastore-pinning" rel="nofollow">two paragraphs</a> below, the Parse team showed a method that was something like this:</p>
  
  <pre><code>public void getDataFromParse() {
      ParseQuery.getQuery(GameScore.class)
          .findInBackground(new FindCallback&lt;GameScore&gt;() {
              @Override
              public void done(final List&lt;GameScore&gt; objects, ParseException e) {
                  ParseObject.unpinAllInBackground(oldPinnedData, new DeleteCallback() {
                      @Override
                      public void done(ParseException e) {
                          ParseObject.pinAllInBackground(objects, 
                              new SaveCallback() {
                                  @Override
                                  public void done(ParseException e) {
                                      // Show data
                                  }
                              }
                          );
                      }
              });
          }
  }
  </code></pre>
  
  <p>So, basically: First, query the updated Parse data on the cloud. Then, unpin the old data that you have. Finally, pin the new one.</p>
  
  <p>In <a href="https://www.parse.com/tutorials/using-the-local-datastore" rel="nofollow">another one</a>, they don't even unpin the old, local data, but they <em>do</em> pin the new one just taken from the cloud.</p>
  
  <pre><code>private void loadFromParse() {
      ParseQuery&lt;Todo&gt; query = Todo.getQuery();
      query.findInBackground(new FindCallback&lt;Todo&gt;() {
          @Override
          public void done(List&lt;Todo&gt; todos, ParseException e) {
              if (e == null) {    
                  ParseObject.pinAllInBackground((List&lt;Todo&gt;) todos,
                      new SaveCallback() {
                          @Override
                          public void done(ParseException e) { 
                              if (e == null) {
                                  // show them
                              }
                          }
                      });
              }
          }
      });
  }
  </code></pre>
  
  <p>I am <strong>very confused</strong>, and I don't understand the relationship between local datastore and the Parse cloud. </p>
  
  <p>Personally, I'm in a situation where the cloud always wins over local data.</p>