import { $group } from "./group";
import { $sort } from "./sort";
const $sortByCount = (collection, expr, options) => {
  return $sort(
    $group(collection, { _id: expr, count: { $sum: 1 } }, options),
    { count: -1 },
    options
  );
};
export {
  $sortByCount
};
