Skip to content
Advertisement

How can I access & sterilize my Javascript user object from Parse server before sending to client?

I do not have a clue why I cannot sterilize my user object array server side. I am having issues accessing any properties at all server side no matter what I’ve tried I get either errors or empty results. In my Flutter/Dart code I can access any properties as normal but of course I do not want users to be able to get all such data.

So the question is, why can’t I access properties server side and how can I do this?

EDIT: On some help in comments it has been discovered that this “object” is not in fact an array, this makes things more difficult. Also does not make sense that I can access the “not array” normally in my flutter dart code… any ideas whats wrong?

For below I am following this My code that works, returning a list of Parse User objects:

JavaScript

Users array returned as above:

JavaScript

Advertisement

Answer

‘Tis the season to be async:

JavaScript

Also special functions you can use on the Parse.Query object: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/parse/index.d.ts (search for class Query)

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement