Currently, my application stores various forum posts. Users can add new messages and create new messages. Other users - when displaying content - can filter it so that they do not see the content downloaded by specific users that they blocked earlier.
Each user is presented as a combination of device_idand display_name.
When users upload content, they execute a request postand include an array of previously blocked users:
"blockedUsers": (
{
"device_id" = "XXX";
"display_name" = XXX;
},
{
"device_id" = "YYY";
"display_name" = YYY;
}
)
Currently, it is possible to add content with some registered name display_name or anonymously.
display_name:
if(blockedUsers) {
var excludedUsernames = [];
for(var i in blockedUsers) {
excludedUsernames.push(blockedUsers[i]['display_name']);
}
query.$and.push({ 'display_name': { $nin: excludedUsernames } });
}
- - display_name ( anonymous) - , device_id, , , display.name.
, :
"blockedUsers": (
{
"device_id" = "XXX";
"display_name" = "anonymous";
},
{
"device_id" = "YYY";
"display_name" = "anonymous";
}
)
device_id display_name == anonymous. , - device_id, display_name!= anonymous - .
, , , ? !