We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, as I can see in different tutorials (ex. https://www.mongodb.com/blog/post/quick-start-golang--mongodb--data-aggregation-pipeline) they use mongo.Pipeline which is []bson.D. In code for SimpleAggregateCursorWithCtx pipeline is bson.A (not bson.D which is ordered):
mongo.Pipeline
[]bson.D
SimpleAggregateCursorWithCtx
bson.A
bson.D
func (coll *Collection) SimpleAggregateCursorWithCtx(ctx context.Context, stages ...interface{}) (*mongo.Cursor, error) { pipeline := bson.A{} for _, stage := range stages { if operator, ok := stage.(builder.Operator); ok { pipeline = append(pipeline, builder.S(operator)) } else { pipeline = append(pipeline, stage) } } return coll.Aggregate(ctx, pipeline, nil) }
Can you please say, if I want aggregation with $match at first and $lookup, can I use SimpleAggragation methods?
$match
$lookup
The text was updated successfully, but these errors were encountered:
mehran-prs
No branches or pull requests
Hi, as I can see in different tutorials (ex. https://www.mongodb.com/blog/post/quick-start-golang--mongodb--data-aggregation-pipeline) they use
mongo.Pipeline
which is[]bson.D
. In code forSimpleAggregateCursorWithCtx
pipeline isbson.A
(notbson.D
which is ordered):Can you please say, if I want aggregation with
$match
at first and$lookup
, can I use SimpleAggragation methods?The text was updated successfully, but these errors were encountered: