Mongorestore gz file

I’m trying use mongorestore with gz file:

i’ve the following directory:

__/tmp/bkp/dbbkp
   |__ collection1.bson
   |__ collection1.metadata.json
   |__ collection2.bson
   |__ collection2.metadata.json
   |__ collection3.bson
   |__ collection3.metadata.json

and i’m using
tar -cvzf /tmp/bkp/dbbkp.gz /tmp/bkp/dbbkp/*

and now i’ve the following files

__/tmp/bkp/dbbkp/
__/tmp/bkp/dbbkp.gz

now i want

mongorestore --gzip --archive=/tmp/bkp/dbbkp.gz

but i get this message

Failed: stream or file does not appear to be a mongodump archive

how can i use mongorestore in dbbkp.gz?

First you have to untar your dump then use mongorestore
or while using mongodump use archive and then use mongorestore with gzip

The --archive flag can only be used if you used --archive when performing the mongodump to create an archive file.

You should just be able to do mongorestore --gzip <path to gzip folder).

Side note you can use mongodump with --gzip option and it will compress it for you.

Here is the documentation on using gzip with a restore