-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Milestone
Description
the test says:
it('should sort records using multiple sort criteria, with first name asc', function(done) {
User.find({ where: { type: 'sort test multi' }, sort: { last_name: 1, first_name: 1 } }
but as there is no defined order for object fields (hash/dictionary keys), then you can not meaningfully specify multi-key sort order using dictionaries. It has to be an Array, so the test (and implementations) should do:
User.find({ where: { type: 'sort test multi' }, sort: [{ last_name: 1}, {first_name: 1 }] }
to guarantee that result is sorted on last_name first and then on first_name
Reactions are currently unavailable