in express remove page ,sort ,limit and fields from req.query

const { page, sort, limit, fields, ...filteredQuery } = req.query;

Explanation:

  1. Destructuring assignment is used to extract the page, sort, limit, and fields properties from the req.query object, while the remaining properties are collected into the filteredQuery object.
  2. The page, sort, limit, and fields properties are removed from the req.query object, and the remaining properties are stored in the filteredQuery object. ```