我想知道用户/通知类型场景的最佳方案是什么,如下所示:
1 | 01-04-2020 | X | John liked your post2
2 | 01-03-2020 | X | Mike and 9 other persons liked your post1
3 | 01-02-2020 | | Rose and 2 other persons liked your post1
4 | 01-01-2020 | | Bernard liked your post1
x = notification has not been read by the user yet
post1 = the same post in all the notifications
Run Code Online (Sandbox Code Playgroud)
假设我有一个通知集合,例如:
_id: ObjectID
receiver: ObjectID (User)
sender : ObjectID (User)
type: String ("post", …Run Code Online (Sandbox Code Playgroud)