小编Eta*_*nor的帖子

MongoDB 用户通知方案建议

我想知道用户/通知类型场景的最佳方案是什么,如下所示:

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)

mongoose mongodb mongoose-schema

3
推荐指数
1
解决办法
959
查看次数

标签 统计

mongodb ×1

mongoose ×1

mongoose-schema ×1