As a newbie to Mongodb am facing this problem to query from different collection based on conditions from those collections and not just one:
I'm actually recieve a user email as a query request to my Rest API, this user can be either linked to a personnel Account or to a company Account.
In this case I want to retrieve all the company that are Active for a user having the email from my token and the user.LinkedEntity == "Company" and user.LinkedEntityId == CompanyId
public class User
{
public int Id { get; set; }
public string Email { get; set; }
public string LinkedEntity { get; set; }
public string LinkedEntityId { get; set; }
}
public class Person
{
public int Id {get; set;}
public int Name {get; set;}
}
public class Company
{
public int Id {get; set;}
public string Label {get; set;}
public bool Active {get; set;}
}