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

238
Vistas
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
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