Skip to content

Commit

Permalink
Adiciona canonicalName nas ocorrências
Browse files Browse the repository at this point in the history
  • Loading branch information
Phenome committed Dec 14, 2023
1 parent 95edcb9 commit 83eddf5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ocorrencia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ await Promise.all([
{
key: { ipt: 1 },
name: 'ipt'
}
},
{ key: { canonicalName: 1 }, name: 'canonicalName' }
]
}),
iptsCol.createIndexes({
Expand Down Expand Up @@ -112,6 +113,13 @@ for (const { ipt: iptName, baseUrl, datasets } of iptSources) {
batch.map((ocorrencia) => ({
iptId: ipt.id,
ipt: iptName,
canonicalName: [
ocorrencia[1].genus,
ocorrencia[1].specificEpithet,
ocorrencia[1].infraspecificEpithet
]
.filter(Boolean)
.join(' '),
...ocorrencia[1]
})),
{
Expand Down

0 comments on commit 83eddf5

Please sign in to comment.