What are the best practices for user preferences on a specific object?
For example: Modeling a chatroom entity.
The chatroom have some components, a creation date, a name.
Now I would add a new feature: the chatroom could be “pinned at top”.
So essentially the pinned chat always show up on the top of the list.
An easy way to manage it is to add a “pinned” property, which is a list of user names that pinned that specific chat.
But here I see a privacy problem, because this let all users to see who pinned the chat.
Sure, it isn’t a great problem in this case, but could it be in others.
An other way to model it could it be create another document, “chat_preferences”, that contain user specific preferences, accessible only from the corresponding user.
But in that case I can’t see how could the mobile application show the list of chatrooms ordered by pinned.
It could be easy to done if N1QL would be available (with a join), but on mobile is not (at least until 2.0 will become in production).
So how could I do? Query for “chat_preferences” instead of chats?