Is there a simple way to export the data from a meteor deployed app?

后端 未结 12 2131
轻奢々
轻奢々 2020-11-30 16:30

Is there a simple way to export the data from a meteor deployed app?

So, for example, if I had deployed an app named test.meteor.com...

How could I easily d

12条回答
  •  悲哀的现实
    2020-11-30 17:17

    Here is a simple bash script that lets you dump your database from meteor.com hosted sites.

    #!/bin/bash
    
    site="rankz.meteor.com"
    name="$(meteor mongo --url $site)"
    echo $name
    
    IFS='@' read -a mongoString <<< "$name"
    
    echo "HEAD: ${mongoString[0]}"
    echo "TAIL: ${mongoString[1]}"
    
    IFS=':' read -a pwd <<< "${mongoString[0]}"
    
    echo "${pwd[1]}"
    echo "${pwd[1]:2}"
    echo "${pwd[2]}"
    
    
    IFS='/' read -a site <<< "${mongoString[1]}"
    
    echo "${site[0]}"
    echo "${site[1]}"
    
    
    mongodump -u ${pwd[1]:2} -h ${site[0]} -d ${site[1]}\
              -p ${pwd[2]}
    

提交回复
热议问题