Mongoose populating grouped objects with ref

So I am basically creating simple restaurant manager app where i have menumodel with all schema for the items in the menu, tableModel for tables and orerModel for ordrs.
now in a page i am displaying all the orders in a page and i want to group by item name and table number and display the count of each. Can you please help me achieve this. I am just starting out in MERN so this is all new to me. I have tried $group but its somewhat not right, i have also tried lodash but it gives me the group contents.
and in the ordermodel i have added references to menuModel and tableModel so it becomes a lil difficult or tricky at this point

Menu Model

import mongoose, { model } from "mongoose";
const { Schema } = mongoose;

const menuSchema = new Schema({
    item: {
        type: String,
        required: true,
        unique: true,
    },
    price: {
        type: Number,
        required: true,
        default: 0.0,
    },
    veg_or_nonveg: {
        type: String,
        required: true,
        enum: ["Veg", "Non-Veg", "veg", "non-veg"],
    },
    description: {
        type: String,
        trim: true,
    },
    category: {
        type: Schema.Types.ObjectId,
        ref: "categoryModel",
    },
});

export const menuModel = new model("menuModel", menuSchema);

Table Model

import mongoose, { model } from "mongoose";
const { Schema } = mongoose;
import moment from "moment";

const tableSchema = new Schema(
    {
        tableNo: {
            type: Number,
            required: true,
            unique: true,
        },
        customerName: {
            type: String,
            trim: true,
        },
        occupants: {
            type: Number,
            default: 0,
        },
        veg_or_nonveg: {
            type: String,
            required: true,
            enum: ["veg", "non-veg", "both"],
        },
    },
    { timestamps: true }
);

export const tableModel = new model("tableModel", tableSchema);

Order Model

import mongoose from "mongoose";
const { Schema } = mongoose;

const orderSchema = new Schema({
    tableId: {
        type: Schema.Types.ObjectId,
        ref: "tableModel",
        required: true,
    },
    itemId: {
        type: Schema.Types.ObjectId,
        ref: "menuModel",
        required: true,
    },
    status: {
        type: String,
        enum: [
            "confirmed",
            "cooking",
            "ready_to_deliver",
            "delivered",
            "cancelled",
        ],
        default: "confirmed",
    },
});

export const orderModel = mongoose.model("orderModel", orderSchema);

and these are the controllers for orders

import { orderModel } from "../models/orderModel.js";

export const getOrders = async (req, res) => {
    try {
        const orders = await orderModel
            .find()
            .populate("itemId", "item")
            .populate("tableId", "tableNo");
        res.status(200).json(orders);
    } catch (error) {
        res.status(400).json({ message: error.message });
        console.log(error.message);
    }
};

export const getOneOrder = async (req, res) => {
    const { id } = req.params;
    try {
        const order = await orderModel
            .find({ _id: id })
            .populate("itemId", "item")
            .populate("tableId", "tableNo");
        res.status(200).json(order);
    } catch (error) {
        res.json({ message: error.message });
    }
};

export const addOrder = async (req, res) => {
    try {
        const order = req.body;
        const newOrder = new orderModel(order);
        await newOrder.save();
        res.status(201).json(newOrder);
    } catch (error) {
        res.status(400).json({ message: error.message });
        console.log(error.message);
    }
};

export const getOrderByTable = async (req, res) => {
    const { id } = req.params;
    try {
        const orders = await orderModel
            .find({ tableId: id })
            .populate({
                path: "itemId",
                select: "item price",
            })
            .populate("tableId", "tableNo");
        res.status(200).json(orders);
    } catch (error) {
        res.status(400).json({ message: error.message });
    }
};

export const deleteOrder = async (req, res) => {
    try {
        const { id } = req.params;
        const order = await orderModel.findByIdAndDelete(id);
        res.status(200).json(order);
    } catch (error) {
        res.status(400).json({ message: error.message });
    }
};

export const deleteAll = async (req, res) => {
    const { id } = req.params;
    try {
        const deleteOrders = await orderModel.deleteMany({
            tableId: { _id: id },
        });
        res.status(200).json(deleteOrders);
    } catch (error) {
        res.status(400).json({ message: error.message });
    }
};

export const updateOrder = async (req, res) => {
    const { id } = req.params;
    const order = req.body;
    try {
        const updatedOrder = await orderModel.findByIdAndUpdate(id, order, {
            new: true,
        });
        res.status(200).json(updatedOrder);
    } catch (error) {
        res.status(400).json({ message: error.message });
    }
};

and if there are any other suggestion please do tell i would like to learn

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật