Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-751

Incorrect example in godoc website

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 0.3.0
    • Affects Version/s: No Release
    • Component/s: Documentation
    • None

      The `mongo.Pipeline{}` example in this link, https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Pipeline, is incorrect.

      mongo.Pipeline{{
      	{"$group", bson.D{{"_id", "$state"}, {"totalPop", bson.D{"$sum", "$pop"}}}},
      	{"$match": bson.D{{"totalPop", bson.D{"$gte", 10*1000*1000}}}},
      }}
      

      It should be as follows:

      mongo.Pipeline{{
      	{{"$group", bson.D{{"_id", "$state"}, {"totalPop", bson.D{{"$sum", "$pop"}}}}}},
      	{{"$match", bson.D{{"totalPop", bson.D{{"$gte", 10 * 1000 * 1000}}}}}},
      }}
      

            Assignee:
            isabella.siu@mongodb.com Isabella Siu (Inactive)
            Reporter:
            ken.chen@mongodb.com Ken Chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: