Home > Enterprise >  I need to retrieve the index(number 1) information in mongodb compass
I need to retrieve the index(number 1) information in mongodb compass

Time:01-08

I just need to query all information of the doctor in the first index.

enter image description here

Find doctor by name query

{ name: "Mavis Bxxxed" }

enter image description here

Find doctor by patient name

{ "patients.name": "Some one" }

enter image description here

If same search with this query

{ "patients.name": "Itch Txxx" }
OR
{ "patients.name": "Damon Wxxx" }

will same result to find the first docker (Mavis Bxxxed) Due to it's patients start [ and end ]. it is array type a single size of data.

You can filter by project option

  {
    patients: {
      $filter:
      {
          input: "$patients",
          cond: { $eq: [ "$$patient.name", "Itch Txxx"] },
          as: "patient"
      }
    }
  }

enter image description here

OR shows only address

{ "patients.address" : 1 }

enter image description here

  • Related