Rule expressions with additional table

Suppose I have a table with roles and an item table. Only the role id is stored in the user datа. To get the user’s items, I first need to get the role from the roles table and then, taking into account this role, get access to the item.

Is it possible to create Rule Expressions taking into account data from an additional table?

Hi @Vlad_Ustenko and welcome to the MongoDB community forum!!

If I understand correctly, you have two different collections, one which contains the role ID and their item information in a different collection trying to establish a one to many relationship.
Could you help me understand as why do you need to store the role id in a different collection.

This would nor only makes the query faster, but the involved would also be simple. You can visit the documentation on data modelling for detailed understanding.

To help you better with the appropriate solution, can you please share the below details:

  1. Sample document from both the collections.
  2. The desired output from the query.
  3. The query tried for fulfilling the requirement.
  1. Can you also confirm, the Rule expression is similar to the Atlas App services Rule Expression.