i have two models, i need to get model A data that have reference in model B by array id, this is my model A object
{
"_id": "62eb2f788345c04a74057903",
"location": "usa"
}
and this is my model B
{
"_id": "62eb2f788345c04a74057903",
"name": "task",
"desc": "test task",
"location_id ":["62eb2f788345c04a74057903", "62eb2f788345c04a74057904"]
}
how can i get model data A from model data B query by jenssegers library? is there any other solutions for this case? i've try use hasMany and belongToMany but the result is null,