我在我的项目中使用 Go 和 MongoDB。我用过
db.collection.aggregate([{$match:{}},{$lookup:{}},{$addFields:{}}])
它在 MongoDB 中运行良好,但是当我在 Go 中使用管道时,出现以下错误
The 'cursor' option is required, except for aggregate with the explain argument
去代码是
matchStage:=bson.M{"$match":bson.M{}}
pipeline := collection.Pipe([]bson.M{matchStage})
err = pipeline.All(&resp)
沧海一幻觉
相关分类