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

90
Views
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
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!