In the next example, mongoimport takes data passed to it on standard input (i.e. with a | pipe.)
Without the output specification (i.e. “-o collection.json”), mongoexport writes output to standard output (i.e. “stdout”).
mongoexport -d dbname -c colname | gzip > dump.txt.gz zcat dump.txt.gz | mongoimport -d dbname -c colname
Big Thnx! Exactly what I was looking for!