I am using mongodb and using mongoose to manipulate the database.
Here I have a set of docs that I would like to sort them by numbers of elements in the array.
Is there a way to sort them by its array length, in mongoose?
Below is an example of the db. I would like to sort them by the number of tags. OR by the number of likeBy (which is an array of userId)