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

106
Views
¿Cómo busco los datos de mangosta con múltiples propiedades?

Hice un equipo por usuarios (ID de usuario), ahora quiero buscar si ese usuario está presente en el equipo o no.

 exports.start = async (message) => { const check = await group.find({userID1:message.author.id} ||{userID2:message.author.id} || {userID3:message.author.id}) console.log(check); }

Mi base de datos se ve así

 { "_id" : ObjectId("6173107fcf643f15e1fced83"), "userID1" : "769819933390667796", "userName1" : "Davion", "userID2" : "247276609894219777", "userName2" : "Davion", "userID3" : "898413310872006716", "userName3" : "Davion", "team" : "3", "__v" : 0 }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

$o como lógico o operador

 exports.start = async (message) => { const check = await group.find({ $and: [ { $or: [ { userID1: message.author.id }, { userID2: message.author.id }, { userID3: message.author.id } ] } ] }) console.log(check); }

$and realiza una operación AND lógica en una matriz de una o más expresiones (expresión1, expresión2, etc.) y selecciona los documentos que satisfacen todas las expresiones.

 exports.start = async (message) => { const check = await group.find({ $and: [ { userID1: message.author.id }, { userID2: message.author.id }, { userID3: message.author.id } ] }) console.log(check); }
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!