Find or findOne returns empty array when parameters are passed but it works in mongo shell

I’m using mongoDB 4.4.3 and mongoose 5.10.8 and mac OS catalina

Can anyone help me with the error in the below code why find or findOne is returning empty array when a parameter is passed when it has data in database. When i queried vis mongo shell find and find one returns value. Only when parameter is passed it is not returning value but it returns value for find and find one with no parameter passed why??? what mistake???

const mongoose = require('mongoose');
const Schema = new mongoose.Schema({
        categoryName: {
            type: String,
            trim: true
        subcategory: [ {
            subcategoryName: {
                type: String,
                trim: true

 module.exports = mongoose.model('categories', Schema);

controller code:

const categories = require('../models/category');
exports.getCategory = (req, res, next) => {

categories.find({"categoryName":{ $regex:, $options: 'i' }},(err, products) => {
  if (err) {
         return res.status(400).json({
           error: "No Products found"+err

routes code:

const categoryCtrl = require('../controllers/category'); routes.get('/category/getCategory/:id', categoryCtrl.getCategory);

GET call URL via postman:


Any mistakes in my code i need help on this