I have a post document like so
author: '828287',
content: 'xyz',
time: 88273622324
And my user document looks like
id: '345678',
name: 'John McClane',
blocked: [{
user: '123214',
time: 88273626362
},{
user: '345654',
time: 88273698678
},{
user: '554568',
time: 88273658858
}],
created: 127381283
How can I select all of the posts that are by authors whose user id is not in my blocked field?
EDIT: Additionally, how can I select all of the posts by authors who are blocked, but only if the time of the post is prior to the time of the block? This means blocking a user will only block future posts and existings posts will not be affected.
authorfield in thepostschema isstringorint?authorfield of the post document supposed to match with theidfield of the user document? What is the significance ofblocked[i].user?authorfield is String. Yes, theauthorfield of the post document is equal to theidfield of the user who posted it.blockedis an array of users whose posts have been blocked and therefore, we do not want to select them.