I have a collection “documents” and “request_documents”.
I want to check “members” which has access on “documents” from “request_documents”
documents
_id
folderName
-------------------------
request_document:
_id
documentId
memberId
isAccept
deny
so when user want to “Get” data to “documents”, query gonna check is member be able to access the document if he/she in the “request_document”, if that member “_id” available on the “request_document”, then the respond on document gonna has this:
documents
_id
folderName
hasAccess
so on “hasAccess” gonna has logic like this => if member _id exist in collection “request_document” and “isAccept” true, then “hasAccess” gonna be true , and if exist but isAccept and deny false, then “waiting”, otherwise “false”
is that possible to do that and how to I added new fields for that??