Tengo un archivo JSON de randomuser.me como este. Y quiero filtrar solo algunos de los datos, como nombre, inicio de sesión, correo electrónico y eliminar otros. pero no sé cómo hacer esto con mongoose y 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 } ]Quiero obtener estos datos y devolver el tema como datos JSON como este, pero no encuentro la consulta correcta.
{ "name": { "title": string, "first": string, "last": string }, "email": string, "login": { "uuid": string, "username": string }, "registered": { "date": datetime, "age": int }, "picture": { "thumbnail": string } }