Evgenii
По терминалу mongo не падал
По логам хз нормальные ли логи или что-то не так
{"t":{"$date":"2021-04-28T05:27:34.249-04:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn73858","msg":"Connection ended","attr":{"remote":"127.0.0.1:56636","connectionId":73858,"connectionCount":1}}
{"t":{"$date":"2021-04-28T05:27:41.251-04:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:57124","connectionId":73859,"connectionCount":2}}
{"t":{"$date":"2021-04-28T05:27:41.252-04:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn73859","msg":"client metadata","attr":{"remote":"127.0.0.1:57124","client":"conn73859","doc":{"driver":{"name":"mongo-ja${"t":{"$date":"2021-04-28T05:27:44.253-04:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn73859","msg":"Connection ended","attr":{"remote":"127.0.0.1:57124","connectionId":73859,"connectionCount":1}}
{"t":{"$date":"2021-04-28T05:27:51.255-04:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:57532","connectionId":73860,"connectionCount":2}}
{"t":{"$date":"2021-04-28T05:27:51.255-04:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn73860","msg":"client metadata","attr":{"remote":"127.0.0.1:57532","client":"conn73860","doc":{"driver":{"name":"mongo-ja${"t":{"$date":"2021-04-28T05:27:52.182-04:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:57564","connectionId":73861,"connectionCount":3}}
{"t":{"$date":"2021-04-28T05:27:52.183-04:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn73861","msg":"client metadata","attr":{"remote":"127.0.0.1:57564","client":"conn73861","doc":{"driver":{"name":"mongo-ja${"t":{"$date":"2021-04-28T05:27:52.187-04:00"},"s":"I", "c":"ACCESS", "id":20250, "ctx":"conn73861","msg":"Successful authentication","attr":{"mechanism":"SCRAM-SHA-256","principalName":"serverClient","authenticat${"t":{"$date":"2021-04-28T05:27:54.258-04:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn73860","msg":"Connection ended","attr":{"remote":"127.0.0.1:57532","connectionId":73860,"connectionCount":2}}
{"t":{"$date":"2021-04-28T05:27:55.182-04:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn73861","msg":"Connection ended","attr":{"remote":"127.0.0.1:57564","connectionId":73861,"connectionCount":1}}
{"t":{"$date":"2021-04-28T05:27:56.076-04:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1619602076:76968][7325:0x7f3bf4c1e700], WT_SESSION.checkp${"t":{"$date":"2021-04-28T05:28:01.259-04:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:57886","connectionId":73862,"connectionCount":2}}
{"t":{"$date":"2021-04-28T05:28:01.259-04:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn73862","msg":"client metadata","attr":{"remote":"127.0.0.1:57886","client":"conn73862","doc":{"driver":{"name":"mongo-ja${"t":{"$date":"2021-04-28T05:28:04.262-04:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn73862","msg":"Connection ended","attr":{"remote":"127.0.0.1:57886","connectionId":73862,"connectionCount":1}}
{"t":{"$date":"2021-04-28T05:28:11.264-04:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:58714","connectionId":73863,"connectionCount":2}}
{"t":{"$date":"2021-04-28T05:28:11.264-04:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn73863","msg":"client metadata","attr":{"remote":"127.0.0.1:58714","client":"conn73863","doc":{"driver":{"name":"mongo-ja${"t":{"$date":"2021-04-28T05:28:14.266-04:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn73863","msg":"Connection ended","attr":{"remote":"127.0.0.1:58714","connectionId":73863,"connectionCount":1}}
karrtopelka
{
$match: {
eventType,
'properties.bId': boothId,
'properties.targetText': 'VIEW',
'properties.bTab': /documents/i,
_updatedAt: {
$gte: new Date(`${ from }T00:00:00`),
$lte: new Date(`${ to }T23:59:59`),
},
},
},
{
$group: {
_id: '$userId',
users: { $push: '$$ROOT' },
},
},
{
$lookup: {
from: 'users',
localField: '_id',
foreignField: '_id',
as: 'userInfo',
},
},
{
$unwind: {
path: '$userInfo',
includeArrayIndex: 'string',
preserveNullAndEmptyArrays: false,
},
},
{
$project: {
eventType: 1,
document: '$properties.targetLink',
time: '$_updatedAt',
userId: '$_id',
name: '$userInfo.name',
email: { $arrayElemAt: ['$userInfo.emails.address', 0] },
},
},