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

219
Views
¿Cómo puedo eliminar las comillas de mi valor en el operador $in?

Quiero hacer un collection.find() con filtro en MongoDB. Sin embargo, necesito pasar una variable dentro de mi operador $in para tener exactamente este formato:

 { '$in': [ /^S/ ] }

Pero en realidad tengo este formato:

 { '$in': [ '/^S/' ] }

Con este código:

 let term = req.query.term; console. log ("term:", term); const filter = { "firstname": { $in: ("/^ + term + "/"] } }; console. log(filter); const answer = await collection.find (filter). toArray();
about 4 years ago · Santiago Gelvez
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!