Saturday 15 April 2017

defining function order to mongoose

I have a situation where I'd like to order my data from mongodb defining my own function.

something like that:

  Items
    .find()
    .sort(myFunction())
    .exec(callback);

do someone have some idea how to do that!?



via Eduardo Spaki

No comments:

Post a Comment