Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change to a synchronous query? #860

Closed
xcg340122 opened this issue Sep 21, 2022 · 2 comments
Closed

How to change to a synchronous query? #860

xcg340122 opened this issue Sep 21, 2022 · 2 comments

Comments

@xcg340122
Copy link

xcg340122 commented Sep 21, 2022

I want to change the query process to a synchronous operation..
Something like this:let arr = await worlds.find(function(err, results) { return results; });

@dxg
Copy link
Collaborator

dxg commented Oct 6, 2022

Hey, you can do this:

const arr = await worlds.findAsync();

All callback methods have an *Async counterpart.

See the Promises section of the readme.

@dxg dxg closed this as completed Oct 6, 2022
@xcg340122
Copy link
Author

To understand the,thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants