Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WebBack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
websystem
WebBack
Merge requests
!28
[#21] bugfix: chatroom 관련 오류해결
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[#21] bugfix: chatroom 관련 오류해결
test/#21
into
develop
Overview
0
Commits
1
Pipelines
0
Changes
8
Merged
세현 임
requested to merge
test/#21
into
develop
3 months ago
Overview
0
Commits
1
Pipelines
0
Changes
8
Expand
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
12de45f3
1 commit,
3 months ago
8 files
+
63
−
106
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
models/chatRooms.js deleted
100644 → 0
+
0
−
23
Options
const
mongoose
=
require
(
'
mongoose
'
);
// MongoDB 채팅방 스키마 수정 (FCM 토큰을 배열로 관리)
const
chatRoomsSchema
=
new
mongoose
.
Schema
({
chatRoomId
:
{
type
:
String
,
required
:
true
,
unique
:
true
},
chatRoomName
:
{
type
:
String
,
required
:
true
},
messages
:
[{
sender
:
String
,
message
:
String
,
timestamp
:
Date
,
type
:
{
type
:
String
,
default
:
'
message
'
},
// 기본값은 'message', 다른 값으로 'join', 'leave' 가능
}],
participants
:
[{
name
:
{
type
:
String
,
required
:
true
},
fcmTokens
:
{
type
:
[
String
],
default
:
[]
},
// FCM 토큰 배열
}],
lastReadAt
:
{
type
:
Map
,
of
:
Date
},
lastReadLogId
:
{
type
:
Map
,
of
:
String
},
isOnline
:
{
type
:
Map
,
of
:
Boolean
},
},
{
collection
:
'
chatrooms
'
});
const
ChatRoom
=
mongoose
.
model
(
'
ChatRooms
'
,
chatRoomsSchema
);
module
.
exports
=
ChatRoom
;
\ No newline at end of file
Loading