-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
How many can i get result with query.each ? (maximum size) #6248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please, use stackoverflow for code related questions. Anyway, the code below should solve your problem: Parse.Cloud.job('Purchase', (req,status) => {
var query = new Parse.Query('Subscriptions');
query.each(result => {
let userId = result.get('userId');
var _query = new Parse.Query(Parse.User);
_query.equalTo('objectId', userId);
_query.first({useMasterKey: true}).then((user => {
let date = result.get('end');
let current = new Date();
user.set('isGold', (date > current));
user.save(null,{useMasterKey: true});
}));
}, {useMasterKey: true});
}); |
@davimacedo my code is working perfectly i just asked if the parse class have more than 100k row, will it work again perfectly? |
Your code is wrong. You are using the each function inside the find block. That's not the way it should be used. There is no limit for the each function if you use it correctly. It will do as many find operations are required to make sure that all objects will be returned. |
@davimacedo thx, i had got it from back4app docs :))) https://www.back4app.com/docs/free-cron-job-online |
@memishood thanks for reporting. The example is slightly different because they first used the |
@davimacedo thx sir |
i m using parse jobs on cloud code:
if I have more than 100,000 results in Subscriptions class, does it work for all result ? (query.limit(int) doesn't work with query.each, i tried.)
The text was updated successfully, but these errors were encountered: