3
ParseQuery<ParseObject> query = new ParseQuery<ParseObject>(
                            ParseConstants.CLASS_POSTS);
                    query.findInBackground(new FindCallback<ParseObject>() {

                        @Override
                        public void done(List<ParseObject> posts, ParseException e) {

                            if (e == null) {
                                // we found posts
                                mPosts = posts;


                                ParseObject.pinAllInBackground(mPosts);

I have retrieved posts and saved on parse localDatastore by code shown above. and later I have used ParseQuery<ParseObject> query = ParseQuery.getQuery(ParseConstants.CLASS_POSTS); query.fromLocalDatastore(); to get posts locally.

But by pinAllInBackground method whole copy of posts get downloaded and saved in localstore. I just want to pin new posts. which method I should call?

1
  • I do not want to download all data every time. Commented Aug 20, 2015 at 17:27

1 Answer 1

1

I have found solution. to retrieve only new data we should compare createdAt by adding this to query.

query.whereGreaterthanOrEqualTo("createdAt",dateOfLastRetrievedObject);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.