Skip to content

Tag: mongodb

Sort an array by occurances mongodb

Is it possible to sort an array by occurrences? For Example, given return I am able to get it most of the way there but I cannot figure out how to join them all back together in an array. I have been using an aggregation pipeline Starting with $match to find the site I want Then $unwind on with path: