We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e932363 + 68a16fc commit 7a086fcCopy full SHA for 7a086fc
packages/api/src/users/users.repository.ts
@@ -25,6 +25,8 @@ import {
25
type UUID,
26
} from "mongodb";
27
28
+const MAX_USER_LOGS = 1000;
29
+
30
/**
31
* Upsert user document.
32
*/
@@ -60,8 +62,11 @@ export function upsert(
60
62
data: {
61
63
$each: data,
64
},
65
+ },
66
+ $push: {
67
logs: {
68
$each: logs,
69
+ $slice: -MAX_USER_LOGS,
70
71
72
};
@@ -121,9 +126,10 @@ export function removeData(
121
126
122
127
123
128
124
- $addToSet: {
129
125
130
131
$each: UserLoggerMapper.toDeleteDataLogs(data),
132
133
134
135
@@ -157,6 +163,7 @@ export function updateUserLogs(
157
163
$push: {
158
164
159
165
166
160
167
161
168
162
169
0 commit comments