How to search a column in a collection in mongodb with $in which includes an array of elements for search and also caseInsensitive matching of thos
$in
caseInsensitive
This is pretty simple
const sampleData = [ RegExp("^" + 'girl' + "$", 'i'), RegExp("^" + 'boy' + "$", 'i') ]; const filerObj = { gender : {$in : sampleData}};