관련 테이블 행의 MySQL 데이터베이스에서 데이터를 정렬해야합니다.돛 js 데이터가 채워진 필드로 정렬
우리는 두 가지 모델이 있다고 가정
는ModelOne :
는module.exports = {
tableName: 'modelOne',
attributes: {
// some atributes.........
modelTwo{
model: 'ModelTwo',
columnName: 'model_two_id'
}
}
}
ModelTwo :
module.exports = {
tableName: 'modelTwo',
attributes: {
// some atributes.........
model_two_id: {
type: 'integer',
autoIncrement: true,
primaryKey: true
},
name: 'string'
}
}
내가 같은 것을 할 싶습니다
ModelOne
.find(find_criteria)
.populateAll()
.paginate({page: page, limit: limit})
.sort('modelTwo.name')
.then(...)
는 가능성이있다 일을하는 워터 라인 함수를 사용하지 않고 SQL 쿼리를 작성해야합니까?