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

240
Views
How to retrieve some data in mongoDB using mongoose

I have a JSON file from randomuser.me like this. And I want to filter only few of the data, like name, login, email and remove others. but I don't know how to do this with mongoose and MongoDB.

    "events": [
        {
            "_id": "622a2663658a760100143a4a",
            "place": "Belfast",
            "year": 2022,
            "people": [
                {
                    "name": {
                        "first": "Merita",
                        "last": "Giraud"
                    },
                    "picture": {
                        "large": "https://randomuser.me/api/portraits/women/31.jpg"
                    },
                    "gender": "female",
                    "email": "merita.giraud@example.com",
                    "age": 27,
                    "score": 9.174597203460992,
                    "_id": "622a2663658a760100143a4b"
                },
                {
                    "name": {
                        "first": "Nils",
                        "last": "Adam"
                    },
                    "picture": {
                        "large": "https://randomuser.me/api/portraits/men/9.jpg"
                    },
                    "gender": "male",
                    "email": "nils.adam@example.com",
                    "age": 53,
                    "score": 7.405307108969225,
                    "_id": "622a2663658a760100143a4e"
                },
            ],
            "__v": 0
        }
    ]

I want to get these data and return theme as JSON data like this but I don't find the right query.

    {
       "name": {
       "title": string,
       "first": string,
       "last": string
      },
       "email": string,
       "login": {
         "uuid": string,
         "username": string
      },
       "registered": {
         "date": datetime,
         "age": int
      },
       "picture": {
         "thumbnail": string
      }
  }
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!