dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 379 forks source link

How to change to a synchronous query? #860

Closed xcg340122 closed 1 year ago

xcg340122 commented 1 year ago

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 commented 1 year ago

Hey, you can do this:

const arr = await worlds.findAsync();

All callback methods have an *Async counterpart.

See the Promises section of the readme.

xcg340122 commented 1 year ago

To understand the,thank you