feathers-fletching icon indicating copy to clipboard operation
feathers-fletching copied to clipboard

Sort order not respected in joinQuery

Open MarcGodard opened this issue 2 years ago • 2 comments
trafficstars

When sorting with multiple values:

{
	"$sort": {
		"item_code.codeType": 1,
		"item_code.netWeight": 1,
		"quantity": 1
	}
}

joinQuery makes the query with quantity, then applies the other 2. quantity should be applied after.

MarcGodard avatar Aug 30 '23 13:08 MarcGodard

This is a limitation of how the joined sorts work. They HAVE to be sorted first due to how the joins are sorted while filtering. But I suppose we could then re-sort by quantity (and other "local" fields) manually after sorting the joins.

DaddyWarbucks avatar Sep 05 '23 23:09 DaddyWarbucks

Yeah I am manually adding that right now, but it would be nice if the sort automatically did this.

MarcGodard avatar Sep 13 '23 16:09 MarcGodard