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

136
Views
si la condición de coincidencia de población de mangosta falló, entonces no necesito un registro principal, ¿cómo puedo manejarlo?

En el modelo groupMember, trato de completar los detalles del grupo y aplico la condición de coincidencia, pero si la condición de coincidencia falla, los registros también dan como resultado que no quiero esos registros.

supongamos que el grupo tiene eStatus D, entonces IgroupId se vuelve nulo pero llega el registro.
salidas dadas a continuación

 const groups = await GroupMembers.find({ iUserId: ObjectId(id) }) .populate({ path: 'iGroupId', select: '-__v', match: { eStatus: { $in: ['Y', 'N'] } } })

Producción

 [ { "_id": "6298ad4ae7d755f6f3b46dda", "iUserId": "629465fe89062bd576a5954a", "iGroupId": { "_id": "6298aca5e7d755f6f3b46dca", "sGroupName": "Maldives from jay1", "eGroupType": "Trip", "sGroupAvatar": "v1654173001/userAvtars/wtkgrqqfjjspjswfbme4.jpg", "dCreatedAt": "2022-06-02T12:27:17.560Z", "dUpdatedAt": "2022-06-02T12:30:01.682Z", "eStatus": "Y" }, "eUserStatus": "Y", "dCreatedAt": "2022-06-02T12:30:02.119Z", "dUpdatedAt": "2022-06-02T12:30:02.119Z", "__v": 0 }, { "_id": "6299caeb3706f2e0d7972d68", "iUserId": "629465fe89062bd576a5954a", "iGroupId": null, "eUserStatus": "Y", "dCreatedAt": "2022-06-03T08:48:43.126Z", "dUpdatedAt": "2022-06-03T08:48:43.126Z", "__v": 0 }

]

about 4 years ago · Juan Pablo Isaza
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!