We have an object called Employee (with 100+ field) . I have a mobile app (developed thru Telerik Platform) that access this object through JSDO. The client-side JSDO can access the object through an endpoint:
But it's giving me back a 500 error message 'SQL query contains illegal keyword password'. The Employee object has a 'password' field I don't need it, I only need firstName and lastName but looking at the API log, Rollbase retrieves ALL FIELDS from the object.
My question is, is there a way for me to specify fields to retrieve in /JSDO api? maybe through the api endpoint parameters?
As you have found, the JSDO sends a selectQuery command to the backend.
It looks like the password field is used on the server when processing the request.
Is the password field specified in the request that goes in the HTTP request?
Perhaps, the serve code should escape the name to allow the access to the field.
Regarding the JSDO.
The JSDO does not have an option to specify the fields to retrieve.
You can submit an enhancement/idea to add this support.
If you are interested on looking further into the JSDO, you could look at the function _convertToSQLQueryString().
This function processes the filter and creates the SQL statement.
There are ways that you can define custom properties at the JSDO level and read those properties from the function to use the specified fields instead of "*".
Please let me know if you would like more information on this approach.
I hope this helps,
try using getPage REST API instead of selecQuery.