Search code examples
mongodbmongodb-querymongodb-shell

"..." in MongoDB Shell (version 3.2)


Currently running the following aggregate query in my mongo shell: db.zips.aggregate([{$group:{_id:{"state":"$state"},{population:{$sum: "$pop}}}]) and when I press enter, "..." shows up with a blinking cursor. Is it taking a long time to run or expecting me to continue typing?

Thanks!


Solution

  • I guess you have a brace too much

    db.zips.aggregate([
        {
            $group:{
                _id: {"state":"$state"},
                {population:{$sum: "$pop} // <- Brace at population too much?
            }
        }
    ])