
OPERATIONAL DEFECT DATABASE
...

...
db.getCollection('SomeCollection').find({}, {'array.0':1}) I would expect the above to return documents like: {array:[{a:'a',b:'b'}]} but instead returns all elements of the array, just as empty objects: {array:[{}, {}, {}]} This doesn't make any sense. It seem broken.
thomas.schubert commented on Tue, 11 Jul 2017 22:24:27 +0000: Hi fresheneesz, Please note that this behavior is documented. I would recommend using the $slice to achieve the functionality you're looking for: db.getCollection('SomeCollection').find({}, {array:{$slice:1}}) Kind regards, Thomas fresheneesz commented on Tue, 11 Jul 2017 21:34:54 +0000: Thanks Thomas! fresheneesz commented on Tue, 11 Jul 2017 21:04:58 +0000: Ugh, freaking jira "preformatted" style didn't work.. why can't I edit the ticket I created? Well... ignore the first two and last two curly braces then...
Click on a version to see all relevant bugs
MongoDB Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.