我得到了一个包含$lookup的聚合查询:pipeline=[{'$match':{'_id':ObjectId(layout_id)}},{'$lookup':{'from':'units','localField':'unit_id','foreignField':'_id','as':'layout_unit'}},{'$replaceRoot':{'newRoot':{'$mergeObjects':[{'$arrayElemAt':["$layout_unit",0]}]}}},{'$project':{'layout_unit':0}},{'$lookup':{'from'
我正在尝试使用gomock模拟以下方法funcGetS(tenantNamestring)(*mgo.Session,error){ctx:=apiContext.TContext{}url,err:=connectionURLList.get(tenantName)iferr!=nil{log.GenericWarning(ctx,fmt.Sprintf("connectionto%snotyetcreated,creatingone:%v",tenantName,err),nil)iferr:=connectMongo(tenantName);err==nil{returnGetS