Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

89
Views
How can i search from mongodb with onchange input field?

I am building a warehouse website .In my website i displayed a input field and a search button. By this search button I want to search all the product which includes only my search property not the whole thing. But in mogodb, i can't do this. Because in Mongodb i have to write the whole search property for this. Example : In DB i have an property {name:Jhon Doe, email:jhon00@gmail.com} If my search value (Jhon) it will give me this property, But in mongodb i have to search by full name like (Jhon Doe).How can i solve the problem?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you don't have to to write the whole search property in mongoDb , just use regex like this :

const reg  = new RegExp(inputSearch);
const preson = await Person.findOne({ "name" : { $regex: reg, $options: 'gi' } },
i hope this helped you . Good luck

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!