Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

94
Vistas
partial text search in a referenced field in mongoose

I have a Account collection that contains members field which is an array containing the object ids of users

Account collection

{
  "_id": {
    "$oid": "613fc4a36e988e7ed19ae41c"
  },
  "company": {
    "$oid": "6189a18726ab98246e00e2fa"
  },
  "admin": {
    "$oid": "619541a4cf6b272b14d6508a"
  },
  "members": [
    {
      "$oid": "5b43e81d7f621fc06c01a376"
    },
    {
      "$oid": "619541a4cf6b272b14d6508a"
    },
    {
      "$oid": "56ae2f0d747777c99c2aecc2"
    }]
}

User collection

{
  "_id": {
    "$oid": "5b43e81d7f621fc06c01a376"
  },
  "profile": {
    "name": {
      "first": "surjit",
      "last": "prafullit"
    }
  },
  "status": "Active"
}

I want to implement search on Accounts collection with member's name. I want only those accounts that has the searched member.

Example: If I search "Surjit" in the accounts collection, then I should get the above account and all the other account that has "surjit" as a member.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda