Sails.js: joins

var obsType = (from lk in db.LookUp join lt in db.LookUpType on lk.LookUpTypeId equals lt.LookupTypeId where (lt.FieldName == "OBSType") && !(db.OBSSetting.Select(k => k.OBSTypeId)).Contains(lk.Id) orderby (lk.SortOrder ?? decimal.MaxValue) select new LookUpViewModel { Id = lk.Id, Description = lk.Description }).ToList(); return obsType; 

This is an MVC LinQ query. How to write this join request in js sails.

Three different models are used here: (LookUpType, LookUp, OBSSetting).

Someone please direct this task.

Thanks in advance....

+6
source share
1 answer

You can use waterline associations to join tables, see this . If it doesnโ€™t work for you, you can go for the raw SQL query ( here )

0
source

All Articles