I have the following problem retrieving data from MongoDB using mongoose.
Here is my Schema:
const BookSchema = new Schema( { _id:Number,
Find the posts with title containing : cool , and case insensitive match: (Very Cool have cool also)
cool
case insensitive
Very Cool
const s = 'cool' const regex = new RegExp(s, 'i') // i for case insensitive Posts.find({title: {$regex: regex}})