Использовать :not
CSS-псевдокласс:
document.querySelectorAll('span.test:not(.asd)');
Actually the actual issue was just reverse. the 'recordId' passed to the function was the ObjectID of a record. so, when comparing we should convert that into string. recordId.toString(). So the solution is
function totalActualSale (recordId) {
Record.aggregate([
{
$match : {
'_id':recordId.toString(),
}
},
{
$unwind: { "path": '$SalesList'}
},
{ $group:
{_id:
{
item:"$SalesList.item",
},
pqty: { $sum: '$SalesList.pqty' },
}
},
], function (err, purc) {
console.log("\nStock:"+ JSON.stringify(purc));
});
}
попробуйте следующее:
function totalActualSale (recordId) {
Record.aggregate([
{
$match : {
'_id':new mongoose.mongo.ObjectId(recordId),
}
},
{
$unwind: { "path": '$SalesList'}
},
{ $group:
{_id:
{
item:"$SalesList.item",
},
pqty: { $sum: '$SalesList.pqty' },
}
},
], function (err, purc) {
console.log("\nStock:"+ JSON.stringify(purc));
});
}