balderdashy / balderdashy/sails
Sorting by non non-model fields and no schema
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
**Sails version**: 1.1.0
**Node version**: 11.4.0
**NPM version**: 6.4.1
**DB adapter name**: sails-mongo
**DB adapter version**: ^1.0.1
**Operating system**: Mac OS
Trying to sort by non-mentioned in the model files field (using "schema: false") and getting "Cannot read property 'columnName' of undefined". Got no problems when using fields described in model files.
Also, it used to work fine until I migrated to v1 (from v.012). Now fixed this for myself, changing forge-stage-three-query.js to processed not known fields.
https://github.com/balderdashy/sails/issues/4105 and https://trello.com/c/b57sDgVr/124-adapter-spec-change-to-allow-for-more-flexible-base-values seem related.
Contributor guide
Research direction
Start in forge-stage-three-query.js, where the report says the query processing fails when sorting by a field absent from the model with schema: false. Reproduce the error using a non-model sort field and compare it with sorting by a declared field. Done means the former no longer raises the undefined columnName error and the behavior remains compatible with the related adapter changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100