I am using WatermelonDB as a local database of my app.
I have a method getPlaces()
inside a class AccessDB:
static async getPlaces() {
const postsCollection = database.collections.get('places');
const allPosts = await postsCollection.query().fetch();
return allPosts;
}
Calling getPlaces()
using AccessDB.getPlaces()
with async and await works. How can I fetch the results matching the query?