Skip to content

Commit 259ac27

Browse files
committed
fix(mongo-import): Conserta importação de ocorrências
1 parent 20b8ed4 commit 259ac27

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

.github/workflows/update-mongodb-occurrences.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
deno-version: v1.x
2727
- name: Install zip
2828
run: sudo apt update && sudo apt install zip
29-
- name: Update DB from web
29+
- name: Update DB
3030
env:
3131
MONGO_URI: ${{ secrets.MONGO_URI }}
3232
TEMPDIR: /home/runner/work/DarwinCoreJSON/

src/ocorrencia.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import { config } from 'https://deno.land/x/dotenv@v3.2.2/mod.ts'
21
import { MongoClient } from 'https://deno.land/x/mongo@v0.31.2/mod.ts'
32

43
import { processaZip } from './lib/dwca.ts'
5-
const { MONGO_URI } = config()
64

75
const refUrls = await Deno.readTextFile('./referencias/herbarios.txt').then(
86
(contents) => contents.split('\n')
97
)
108

119
const client = new MongoClient()
12-
await client.connect(MONGO_URI as string)
10+
await client.connect(Deno.env.get('MONGO_URI') as string)
1311
const collection = client.database('dwc2json').collection('ocorrencias')
1412
console.debug('Cleaning collection')
1513
console.log(await collection.deleteMany({}))

0 commit comments

Comments
 (0)