Hey @Andrew_Rusinas , the Go Driver doesn’t have a preference for how you construct queries, the error you are getting is a response from an Atlas Server (i.e. AtlasError). The documentation you provided is specifically for querying federated data. Does running your query in mongosh result in the same error?
{
$lookup: {
from: {
db: "Auth",
coll: "user",
},
localField: "author_id",
foreignField: "_id",
as: "author",
},
}
Here is the documentation for the from field: https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/#std-label-lookup-eq-from:
[from] specifies the collection in the same database to perform the join with.
The Go Driver will construct the database reference from the aggregate chain:
// The database we are operating the aggregate on is "mydb", provide the
// `from` field with the collection name.
myclient.Database("mydb").Aggregate(context.Background(), lookupPipeline)