1.0.2 • Published 6 years ago

mongoose-messaging v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Messsaging:

Channel: A channel is a way to organise user access and message

{
    _id: ObjectId,
    attendee: [USER_ID],
    topic: String,
    createdAt: Date,
}

/user/me/channels

{
  data: [CHANNEL, CHANNEL]
}

/channel/:channelId/messages?page=1

{
	data: [Message, Message]
}

/message/

Message: Typed record which can be display on front end. Associated to Channel

{
    _id: ObjectId,
	from: USER_ID, // populate
	type: ENUM_STRING, //TEXT, AIA_INTERNAL_MAIL
	date: Date,
    channel: String,
	body: String,
	attachment: {
		type: ENUM_STRING,
        url: URL,
		lan: Number,
		loc: Number
    }
}