[GODRIVER-751] Incorrect example in godoc website Created: 07/Jan/19  Updated: 28/Oct/23  Resolved: 29/Jan/19

Status: Closed
Project: Go Driver
Component/s: Documentation
Affects Version/s: No Release
Fix Version/s: 0.3.0

Type: Improvement Priority: Minor - P4
Reporter: Ken Chen Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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}}}}}},
}}


Generated at Thu Feb 08 08:34:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.