Open
Description
Description
Hello, guys. I am making a query to the store filter by an array of ids and sorting by a specific field, but it doesn't matter if I sort ASC or DES the NULL value is always at the first position of the result.
The array of devicesIds is [ "a1732fb5-dca7-4895-a668-eacca0c10fb9", "361ce725-a5dc-4e43-ae73-a29a2ac0eec7" ]
And the last user of those Ids are the following:
- "a1732fb5-dca7-4895-a668-eacca0c10fb9" --> lastUser = NULL // If lastUser is an empty string it works.
- "361ce725-a5dc-4e43-ae73-a29a2ac0eec7" --> lastUser = 'user'
The query for the store is:
...mapGetters('devices', { findDevicesInStore: 'find' }),
const devices = this.findDevicesInStore({
query: {
companyId: this.currentCompany.id,
id: {
$in: devicesIds,
},
$limit: 1,
$sort: { lastUser: 1 }, // also tested with { lastUser: -1 }
},
});
Expected behavior
The result will be the data of the device with ID "361ce725-a5dc-4e43-ae73-a29a2ac0eec7"
Actual behavior
The actual result is the data of the device with ID "a1732fb5-dca7-4895-a668-eacca0c10fb9"
System configuration
feathers-vuex: 3.16.0
Metadata
Metadata
Assignees
Labels
No labels