[DOCS-7383] I believe there is a minor error in the ecosystem use-cases documentation Created: 09/Mar/16  Updated: 11/Jan/17  Resolved: 01/Apr/16

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: Alexander Marquardt Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 7 years, 45 weeks, 6 days ago

 Description   

See: https://docs.mongodb.org/ecosystem/use-cases/storing-comments/#hybrid-schema-design

    # Find this discussion's comment buckets
    buckets = db.comment_buckets.find(
        { 'discussion_id': discussion_id },
        { 'bucket': 1 })
    buckets = buckets.sort('bucket')

I believe that the

{'bucket': 1} 

should not be included in the find, as this would only return a single bucket (which doesn't make sense to be sorted or iterated over as is done in the example).



 Comments   
Comment by Kay Kim (Inactive) [ 01/Apr/16 ]

Hi – in the find,

{ bucket: 1 }

would be the projection. The query filter/predicate is contained in the first { }

Generated at Thu Feb 08 07:54:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.