|
@@ -21,8 +21,9 @@ class Person_roomService extends CrudService {
|
|
}
|
|
}
|
|
let data = await this.model.find(condition).skip(parseInt(skip)).limit(parseInt(limit));
|
|
let data = await this.model.find(condition).skip(parseInt(skip)).limit(parseInt(limit));
|
|
// const notRead = await this.pc.find({ room_id: data.map(i => i._id), is_read: false, receiver_id: p_id });
|
|
// const notRead = await this.pc.find({ room_id: data.map(i => i._id), is_read: false, receiver_id: p_id });
|
|
|
|
+ console.log(data.map(i => ObjectId(i.id || i._id)));
|
|
const aggQuery = [
|
|
const aggQuery = [
|
|
- { $match: { room_id: data.map(i => i._id), is_read: false, receiver_id: ObjectId(p_id) } },
|
|
|
|
|
|
+ { $match: { room_id: data.map(i => ObjectId(i.id || i._id)), is_read: false, receiver_id: ObjectId(p_id) } },
|
|
{
|
|
{
|
|
$group: {
|
|
$group: {
|
|
_id: '$room_id',
|
|
_id: '$room_id',
|