Skip to content

Commit

Permalink
Add depositAddress and payoutAddress indices
Browse files Browse the repository at this point in the history
  • Loading branch information
paullinator committed Mar 30, 2024
1 parent fef971d commit ebe58c1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/initDbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const transactionIndexFields: string[][] = [
['timestamp']
]

const transactionIndexFieldsNoPartition: string[][] = [
['depositAddress'],
['payoutAddress']
]

interface Index {
index: { fields: string[] }
ddoc: string
Expand Down Expand Up @@ -46,6 +51,18 @@ transactionIndexFields.forEach(index => {
transactionIndexes.push(out2)
})

transactionIndexFieldsNoPartition.forEach(index => {
const indexLower = index.map(i => i.toLowerCase())
const out: Index = {
index: { fields: index },
ddoc: indexLower.join('-'),
name: indexLower.join('-'),
type: 'json',
partitioned: false
}
transactionIndexes.push(out)
})

const cacheIndexes: Index[] = [
{
index: { fields: ['timestamp'] },
Expand Down

0 comments on commit ebe58c1

Please sign in to comment.