Skip to content

Commit

Permalink
fix(chat): wrong migration query
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanidis committed Nov 16, 2023
1 parent d777ee8 commit b02721e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/chat/src/migrations/chatMessage.migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const migrateChatMessages = async () => {
deleted: { $exists: false },
};
let chatMessages = await ChatMessage.getInstance().findMany(query, undefined, 0, 100);
while (chatMessages.length === 0) {
while (chatMessages.length !== 0) {
for (const chatMessage of chatMessages) {
await ChatMessage.getInstance().findByIdAndUpdate(chatMessage._id, {
deleted: false,
Expand Down
2 changes: 1 addition & 1 deletion modules/chat/src/migrations/chatRoom.migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const migrateChatRoom = async () => {
deleted: { $exists: false },
};
let chatRooms = await ChatRoom.getInstance().findMany(query, undefined, 0, 100);
while (chatRooms.length === 0) {
while (chatRooms.length !== 0) {
for (const chatRoom of chatRooms) {
await ChatRoom.getInstance().findByIdAndUpdate(chatRoom._id, {
deleted: false,
Expand Down

0 comments on commit b02721e

Please sign in to comment.