var search ='Neha';
db.members.find(name: new RegExp(search)) //For substring search, case sensitive.
db.members.find(name: new RegExp('^' + search + '$')) //For exact search, case sensitive
db.members.find(name: new RegExp(search, ‘i')) //For substring search, case insensitive
db.members.find(name: new RegExp('^' +search + '$', 'i')); //For exact search, case insensitive