For those that were looking for a solution here it is:
var name="Peter";
model.findOne({name: new RegExp('^'+name+'$', "i")}, function(err, doc) {
//Do your action here..
});
More Related Contents:
- Updating a Nested Array with MongoDB
- Mongoose and multiple database in single node.js project
- MongoDB, remove object from array
- How do I update/upsert a document in Mongoose?
- Mongoose find/update subdocument
- Mongoose, Select a specific field with find
- How to sort in mongoose?
- Mongoose difference between .save() and using update()
- Bulk upsert in MongoDB using mongoose
- UnhandledPromiseRejectionWarning: MongooseServerSelectionError
- Mongoose subdocuments vs nested schema
- Why is an _id with ObjectID added to when using MongoDB’s $push to add new object to an array?
- How to set _id to db document in Mongoose?
- What is a TransientTransactionError in Mongoose (or MongoDB)?
- Server Discovery And Monitoring engine is deprecated
- Mongoose Not Creating Indexes
- is there a mongoose connect error callback
- MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
- Node.js mongodb driver async/await queries
- Find after populate mongoose
- What is the difference between id and _id in mongoose?
- JavaScript NoSQL Injection prevention in MongoDB
- Group by Date with Local Time Zone in MongoDB
- MongooseError: Model.findOne() no longer accepts a callback at Function
- Mongoose find() not returning result
- How to properly reuse connection to Mongodb across NodeJs application and modules
- Mongoose auto increment
- Mongoose the Typescript way…?
- Why is my function returning Promise { } [duplicate]
- How to solve Mongoose v5.11.0 model.find() error: Operation `products.find()` buffering timed out after 10000ms”