Export a json file to a collection
- Checkout
- use tezz-io/mongoexport@master
with ->
- uri - in the format
mongodb+srv://<username>:<password>@<cluster-name>.xxxxx.mongodb.net
- export - path of json from root
- db - name of db
- collection - name of collection
- rewrite - true for rewrite, false for append
name: Mongo Export
on:
push:
pull_request:
jobs:
mongoexport:
runs-on: ubuntu-latest
name: Export MongoDB Json file
steps:
- uses: actions/checkout@v2
- name: Export Json
uses: tezz-io/mongoexport@v1
with:
uri: ${{ secrets.MONGO_URI }}
export: a.json
db: testDB
collection: test
rewrite: true