Get objects from Database from JS Coding API

Hello, I’m writing an API from the Coding section in JS. How can I retrieve the objects saved in the Backendless Database to use them in this functions?

Thank you

Hi, @Anonymous_Anonymous7

Welcome to our community and thanks you for trying out Backendless!

How to get data from the database you can be read here - Basic Object Retrieval

Regards,
Viktor

I’v tried
image.png

but it returns an empty object, even if the table “Places” is not empty:

Your code returns prova before it gets the value. The request to Backendless.Data.of( "Places").find is asynchronous. Try adding the await keyword like this:

var prova = await Backendless.Data.of( "Places" ).find();

Regards,
Mark

It returns the following error:

Yes, the function must be declared as async

1 Like

I’ve solved it now.
Thank you

Regards