A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Can ES6 promises be used in Mongoose?

Best Answers

Thanks to Mongoose 4.2+ and ES6 Promises (available in node 4.x) these can be rewritten using a much more pleasant (and powerful IMO) pattern using promises. By default ... Making use of the actual native Promise that ES6 provides, requires very little setup thanks to Mongoose exposing mongoose. read more

Mongoose queries traditionally follow the typical node.js callback pattern. Thanks to Mongoose 4.2+ and ES6 Promises (available in node 4.x) these can be rewritten using a much more pleasant (and powerful IMO) pattern using promises. By default, these query methods return a Promise. read more

Even if you can find a way to use both, it seems like a quite strange way to use Event Emitters. I can see how you’re looking at it to send data further to the next step or back to a listener in the original place, but the thing with Promises as well as the traditional Callbacks is that you can count on a response back to the original calling place. read more

Thanks to Mongoose 4.2+ and ES6 Promises (available in node 4.x) these can be rewritten using a much more pleasant (and powerful IMO) pattern using promises. By default, these query methods return a Promise. read more

Encyclopedia Research

Wikipedia:

Related Facts

Related Question Categories