Given the following code:
Classes.aggregate([
{
$lookup: {
from: "files",
localField: "classId",
foreignField: "_id",
as: "cl"
}
}, {
$unwind: "$files"
},
{
$project: {
"_id": 1,
"files.file": 1
}
},
{
"$group": {
"_id": "$_id"
}
}
]).exec...
I am getting the following error:
Total size of documents in files matching { $match: { $and: [ { _id.str: { $eq: null } }, {} ] } } exceeds maximum document size
I have read other articles on StackOverflow but cant seem to resolve.
I have a collection of classes with _id field in mongodb (ObjectId)
The join statement is trying to join files collection on classId (string)
Please note that the files stable contains a field called buffer which contains base64 data. (large field size)
Thanks in advance, Judson