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

179
Views
Print out all object values from an Array Inside of a Field on MongoDB (javascript)

I have a database that has different fields of data inside a document and I want to print out one of the objects from the array. I am only able to print out values that have values attached and not Arrays.

I am unable to add photos as I am new but this is what I am working with: Database photo

Code:

 async function listEmail(client) {
    const emailListing = await client
        .db("x")
        .collection("y")
        .find({})
        .forEach(function (i) { 
            console.log(`id = ${i.firstName}, email = ${i.authentications.username}`);
        });
}

I would like to just print out their first name and email (username)

This is my Output.

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!