You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#The script will export database to csv with limited fields and following the query {"Sample_ID":{"$regex":"vi"}, "RKI_Submit":{"$regex":"IMS"}}
#usr-username, pass-password, file-outputfile name, server-cluster server names,
#list_fields - fields that would be exported(e.g. Sample_ID) if set to full it will export all of the possible fields, filter - the query what files should be exported (e.g.'{"Sample_ID": "XX0000"}')
#Query example '{"Sample_ID":{"$regex":"vi"},"RKI_Submit":{"$regex":"IMS"}}'
usr=$1
pass=$2
server=$3
filter=$4
echo "Filtering for $filter"
#Sanity checks, check if MongoDB Database Tools were installed
if ! command -v mongoimport
then
echo "MongoDB Database Tools could not be found, please install the tool"