Retrieve object from database and update


In documentation, example shows that - to update object, we need to store it in variable after save().

But I need to query object from database and save. like this:
(Need this in cloud functions)

    const Items = Parse.Object.extend("Items");
    const query = new Parse.Query(Items);
    query.equalTo("tokenAddress", "0x0000000000000000000000000000000000000003");
    const result = await query.first();
    result.set("status", 100);;

I know, that first() function will not work, but what should I use instead? Can’t get it working…

you can try query.first({useMasterKey:true})
and you can also use; to see what you got there.

1 Like