New Issue Checklist
Issue Description
$lookup is unable to grab the order object in spite of having an order that particular _id.
If I remove the $group and try $lookup directly I'm able to get the orderObject. (objectId: '$_p_order', and objectId:'$order' produces the same result)
EventTracking consists of order(pointer object), action(string)
Steps to reproduce
const startingFrom = new Date(new Date() - 7 * 60 * 60 * 24 * 1000)
const pipeline = [{
match: {
action: {
$in: [
'Status updated from: Paid to Approved',
'Status updated from: Approved to Ready'
]
},
createdAt: { $gte: startingFrom }
}
},
{
group: {
objectId: '$_p_order',
date: {
$addToSet: '$createdAt'
},
}
},
{
addFields: {
size: {
$size: '$date'
},
}
},
{
match: {
size: {
$eq: 2
}
}
},
{
lookup: {
'from': 'Order',
'localField': 'objectId',
'foreignField': '_id',
'as': 'OrderObject'
}
}]
try {
const query = new Parse.Query('EventTracking');
const result = await query.aggregate(pipeline, master);
console.log(result);
} catch (error) {
console.log(error);
}
Actual Outcome
{
date: [ [Object], [Object] ],
size: 2,
OrderObject: [],
objectId: '9UpnIHbG8n'
},
Expected Outcome
{
date: [ [Object], [Object] ],
size: 2,
OrderObject: [Object],
objectId: '9UpnIHbG8n'
},
Environment
Server
- Parse Server version:
4.10.3
- Operating system:
Ubuntu 18.04
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
AWS
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
4.4
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
MongoDB Atlas
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
JavaScript
- SDK version:
FILL_THIS_OUT
Logs
New Issue Checklist
Issue Description
$lookup is unable to grab the order object in spite of having an order that particular _id.
If I remove the $group and try $lookup directly I'm able to get the orderObject. (objectId: '$_p_order', and objectId:'$order' produces the same result)
EventTracking consists of order(pointer object), action(string)
Steps to reproduce
Actual Outcome
Expected Outcome
Environment
Server
4.10.3Ubuntu 18.04AWSDatabase
MongoDB4.4MongoDB AtlasClient
JavaScriptFILL_THIS_OUTLogs