1

I'm using the Waterline ORM (PostgresQL adapter) with SailsJS and I have two models:

  1. buildings:

    {
      tableName: 'buildings',
      attributes: {
      id: {
        type: 'integer',
        primaryKey: true
      },
      BuildingName: {type: 'string'},
      BuildingBodyId:{model:'buildingbodies'}
    }
    
  2. bodybuildings:

    {
      tableName: 'buildingbodies',
      id: {
        type: 'integer',
        primaryKey: true,
        required: true
      },
      RequiedBeInField: {type: 'integer'},
      BuildingViewState: {type: 'string'}
    };
    

I trying to return all buildings and use next query:

buildings.find({
  select:['id','BuildingName','BuildingBodyId']})
  .populate('BuildingBodyId')

It's return to result:

 {
     "BuildingBodyId":{
       "id":2,
       "createdAt":"2015-05-07T12:46:55.501Z", 
       "updatedAt":"2015-05-07T12:46:55.501Z"},
     "id":1,
     "BuildingName":"YellowTeaField"
 }

i.e. BuildingBodyId return without RequiedBeInField and BuildingViewState. Can anyone give me a tip on how to get these two tables with all parameters? Thanks.

shoom
  • 11
  • 3

0 Answers0