0

I want to set up my custom code in cloud code of parse.

Parse.Cloud.job("deleteUser", function(request, status) {    
    const query = new Parse.Query("SegmentData");
    query.equalTo("userID", request.userID);
    query.find()
    .then(Parse.Object.destroyAll)
    .catch(function(error) {
        console.error("Error finding related comments " + error.code + ": " + error.message);
    });
    const query2 = new Parse.Query("ShowData");
    query.equalTo("userID", request.userID);
    query.find()
    .then(Parse.Object.destroyAll)
    .catch(function(error) {
        console.error("Error finding related comments " + error.code + ": " + error.message);
    });
});

This is the code I have written so far. I want to destroy all the users that have username. They can be even more than 1000. Will this work if the users have more than 1000 records or do I have to amend my code?

2
  • This should delete the User entries, but not any records associated with those Users Commented Aug 7, 2017 at 12:35
  • I want to delete the data from 2 other tables with this username. Commented Aug 7, 2017 at 12:35

1 Answer 1

1

With the parse-server the limit of each query is 100 you need to set to

query.limit(1000); 

If you want to have 1000 users maximum

You can see here how parse-server test and set the limit of each query:

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.