I’m posting here because I’m completely stuck and I’m not sure what to do. Basically, I have a single collection that contains an array. This collection can be accessed by multiple users however I want to limit the data within the array from being published.
In the example below, the candidateApplications
array contains candidateUserId
for each user. If candidateUserId: 1
views the collection I want my publish function to only return:
Is it possible to do this?
{
"_id": "7ARk3dc2JA8g5pamA",
"jobTitle": "Developer",
"candidateApplications": [
{
"candidateUserId": "1",
"applied": true
}
]
}
Eg: Collection
{
"_id": "7ARk3dc2JA8g5pamA",
"jobTitle": "Developer",
"candidateApplications": [
{
"candidateUserId": "1",
"applied": true
},
{
"candidateUserId": "2",
"applied": false
}
]
}
Path: Publish command
return Jobs.find({ _id: jobCollectionId }, {
fields: {
candidateApplication: 0
}
});