MongoDB indexing for a Parse Server application
问题 We have a social app where users can chat with each other and we’ve reached 350K messages! We recently noticed that as the number of messages is growing, the find operations are getting slower! I believe the issue here is that the Message collection is not indexed. That’s what I want to do now! I found this piece of code at the MongoDB docs: db.comments.ensure_index(('discussion_id', 1)) This is my Message collection: { chatRoom: <Pointer>, user: <Pointer>, text: <String>, isSeen: <Bool> } So