Dump/restore doubt

Hi Team , **
I was doing a dump/restore exercise , initially i was able to dump and restore the fist table from 1 database to other database but when i tried 2nd table it has made the dump file (residents.bson) in dump directory only , now when i am trying to restore the table residents , its giving below error , seems like it is not able to locate the exact residents.bson file for restore , any idea how to deal with this ?

C:\Users\arkhare\Old_laptop\arkhare_backup\arkhare\ARPIT\study\mongo\Course_M103\TESTING\export_import_dump_restore>mongorestore --port 28000 --drop -u “root” -p “root” --authenticationDatabase “admin” --db mydb dump
2020-10-07T12:10:25.609+0530 the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead
2020-10-07T12:10:25.613+0530 building a list of collections to restore from dump dir
2020-10-07T12:10:25.622+0530 don’t know what to do with subdirectory “dump\mydb”, skipping…
2020-10-07T12:10:25.625+0530 0 document(s) restored successfully. 0 document(s) failed to restore.

C:\Users\arkhare\Old_laptop\arkhare_backup\arkhare\ARPIT\study\mongo\Course_M103\TESTING\export_import_dump_restore>

I tried to give \dump\mydb path then it has taken but to my surprise it has restores all the Bson files inside \dump\mydb directory which i was not looking for , Can’t we restore only 1 table through mongodump ?

C:\Users\arkhare\Old_laptop\arkhare_backup\arkhare\ARPIT\study\mongo\Course_M103\TESTING\export_import_dump_restore>mongorestore --port 28000 --drop -u “root” -p “root” --authenticationDatabase “admin” --db mydb dump\mydb\

2020-10-07T12:18:14.037+0530 the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead
2020-10-07T12:18:14.040+0530 building a list of collections to restore from dump\mydb dir
2020-10-07T12:18:14.055+0530 reading metadata for mydb.residents from dump\mydb\residents.metadata.json
2020-10-07T12:18:14.096+0530 reading metadata for mydb.tab1 from dump\mydb\tab1.metadata.json
2020-10-07T12:18:14.133+0530 restoring mydb.residents from dump\mydb\residents.bson
2020-10-07T12:18:14.147+0530 restoring mydb.tab1 from dump\mydb\tab1.bson
2020-10-07T12:18:14.151+0530 restoring indexes for collection mydb.tab1 from metadata
2020-10-07T12:18:14.225+0530 finished restoring mydb.tab1 (21 documents, 0 failures)
2020-10-07T12:18:17.036+0530 [#…] mydb.residents 7.33MB/91.5MB (8.0%)
2020-10-07T12:18:20.037+0530 [###…] mydb.residents 14.9MB/91.5MB (16.3%)
2020-10-07T12:18:23.036+0530 [#####…] mydb.residents 22.4MB/91.5MB (24.5%)
2020-10-07T12:18:26.038+0530 [#######…] mydb.residents 29.6MB/91.5MB (32.3%)
2020-10-07T12:18:29.038+0530 [#########…] mydb.residents 36.1MB/91.5MB (39.4%)
2020-10-07T12:18:32.037+0530 [###########…] mydb.residents 43.6MB/91.5MB (47.6%)
2020-10-07T12:18:35.037+0530 [#############…] mydb.residents 50.8MB/91.5MB (55.6%)
2020-10-07T12:18:38.037+0530 [###############…] mydb.residents 58.3MB/91.5MB (63.8%)
2020-10-07T12:18:41.039+0530 [#################…] mydb.residents 65.7MB/91.5MB (71.9%)
2020-10-07T12:18:44.037+0530 [###################…] mydb.residents 72.4MB/91.5MB (79.2%)
2020-10-07T12:18:47.037+0530 [####################…] mydb.residents 79.7MB/91.5MB (87.2%)
2020-10-07T12:18:50.038+0530 [######################…] mydb.residents 87.1MB/91.5MB (95.3%)
2020-10-07T12:18:51.905+0530 [########################] mydb.residents 91.5MB/91.5MB (100.0%)
2020-10-07T12:18:51.905+0530 restoring indexes for collection mydb.residents from metadata
2020-10-07T12:18:57.515+0530 finished restoring mydb.residents (1000000 documents, 0 failures)
2020-10-07T12:18:57.516+0530 1000021 document(s) restored successfully. 0 document(s) failed to restore.

C:\Users\arkhare\Old_laptop\arkhare_backup\arkhare\ARPIT\study\mongo\Course_M103\TESTING\export_import_dump_restore>

It should be possible to restore single collection
Did you try --collection param?

Since you have not specified this param it is restoring full dump

You can use --out for creating dump to another path instead default

Also check nsInclude parm from mongo documentation