Skip to content

Commit

Permalink
fix(api): add collation to index
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Mar 8, 2022
1 parent 34fd1dd commit 4ea3afb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/api/src/repository/ResultRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ export class ResultRequestRepository {

constructor (db: Db, _dataFeeds: Array<FeedInfo>) {
this.collection = db.collection('result_request')
this.collection.createIndex({ feedFullName: 1, timestamp: -1 })
this.collection.createIndex(
{ feedFullName: 1, timestamp: -1 },
{
collation: {
locale: 'en_US',
numericOrdering: true
}
}
)
}

async getFeedRequests (
Expand Down Expand Up @@ -68,6 +76,10 @@ export class ResultRequestRepository {
{
sort: {
timestamp: -1
},
collation: {
locale: 'en_US',
numericOrdering: true
}
}
)
Expand Down
1 change: 1 addition & 0 deletions packages/ui/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const mutations = {
updateSelectedNetwork(state, { network }) {
state.selectedNetwork = network
},
// TODO: refactor with cleaner approach
updateFromNavBar(state) {
state.updateFromMain = false
},
Expand Down

0 comments on commit 4ea3afb

Please sign in to comment.