From 3a6c1a32bb6073d4cee19e8c0ebd43e7cd0066ed Mon Sep 17 00:00:00 2001 From: Henrique Pinheiro Date: Wed, 13 Mar 2024 15:46:02 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20`iptKingdoms`=20=C3=A0s=20ocorr?= =?UTF-8?q?=C3=AAncias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #65 --- src/ocorrencia.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ocorrencia.ts b/src/ocorrencia.ts index 9cbcdb3..ef89705 100644 --- a/src/ocorrencia.ts +++ b/src/ocorrencia.ts @@ -75,7 +75,8 @@ await Promise.all([ name: 'ipt' }, { key: { canonicalName: 1 }, name: 'canonicalName' }, - { key: { flatScientificName: 1 }, name: 'flatScientificName' } + { key: { flatScientificName: 1 }, name: 'flatScientificName' }, + { key: { iptKingdoms: 1 }, name: 'iptKingdoms' } ]), iptsCol.createIndexes([ { @@ -148,10 +149,12 @@ for (const { repositorio, kingdom, tag, url } of iptSources) { ] .filter(Boolean) .join(' ') + const iptKingdoms = kingdom.split(/, ?/) return { iptId: ipt.id, ipt: repositorio, canonicalName, + iptKingdoms, flatScientificName: ( (ocorrencia[1].scientificName as string) ?? canonicalName )