Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7048403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:53:16+00:00 2026-05-28T02:53:16+00:00

Why when I do a findOne (same with find), does it only show me

  • 0

Why when I do a findOne (same with find), does it only show me the last item in my “acts” array. My collection only contains one document for test purposes.

I’m doing this in the mongo cli: db.mycollection.findOne();

My result of findOne():

{
    "_id" : ObjectId("4f0db64659d044892271018f"),
    "title" : "Awards Show 2012",
    "description" : "An amazing awards show",
    "acts" : [
        {
            "name" : "Act 3",
            "description" : "My act description"
        }
    ]
}

Here is my document:

 {
  "_id": { "$oid" : "4F0DB64659D044892271018F" },
  "title": "Awards Show 2012",
  "description": "An amazing awards show",
  "acts": [
    {
      "name": "Act 1",
      "description": "My act description"
    },
    {
      "name": "Act 2",
      "description": "My act description"
    },
    {
      "name": "Act 3",
      "description": "My act description"
    }
  ]
}

EDIT: Fixed the document – had a typo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:53:17+00:00Added an answer on May 28, 2026 at 2:53 am

    MongoHub is really buggy. Please don’t use it. RockMongo and Genghis are quite good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find one record in the Meeting table that contains the same
Surprisingly I was only able to find one previous question on SO about this
I cant find one way to get this value (comment) into json using javascript.
I've searched for days but couldn't find one solid solution to get the selection
I realise there might be similar questions but I couldn't find one that was
I've read the related questions but I cannot find one that suits my problem(or
I've been playing around with different versioning systems to find one I'm comfortable with.
There is no documentation on cakephp.org and I am unable to find one on
I'm trying to write a static member function in C# or find one in
I have lots(+2000) of GUIDs(in some network class) and my program must find one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.