#1 - Query the table with a pointer, and include the pointer attributes
const query = new Parse.Query("TableX");
query.include("PointerNameY");
const result = await query.first();
#2 Query two tables separately, one for the data, and the other for the pointer attributes
const query = new Parse.Query("TableX");
const result = await query.first();
const pointerQuery = new Parse.Query("PointerNameYTableZ");
const result = await query.first();
#3 - Use an aggregate query with $lookup to combine the table attributes with the attributes of the pointer in one file
As far as I know, approaches 1 and 2 are equal in terms of efficiency, because each “include” makes another query call in the background. How about approach #3 though? is $lookup also making a separate query call? Which of these would be the most efficient in terms of minimizing connection count to the DB and using fewer DB resources?
Thank you