I am trying to run this mongo import command, and this was working fine until yesterday, but now all I get is no such file or directory, I keep on copying the absolute path and it still doesn't work can anyone please help me
This is the import statement: mongoimport --db mydb_backup --collection extra_data --file “/Users/muskanmall/PycharmProjects/BD_HOMEWORK6/updateddata.json” --drop
additionally I also tried moving the file elsewhere and still the same issue: this is the import statement for that: mongoimport -d mydb_backup -c extra_data --type JSON --file “/Users/muskanmall/Desktop/updateddata.json”
This is the error I am getting: Failed: open “/Users/muskanmall/Desktop/updateddata.json”: no such file or directory 2023-03-31T12:41:12.179-0400 0 document(s) imported successfully. 0 document(s) failed to import.
I tried to import it and I got this error, does anyone know why I am facing this issue or does anyone know what I am doing wrong and what would be a correction
I found the solution, I thought I will still keep the question incase someone else faces this issue and I didn't find any matching question.
So the reason this was not working was because my collection name was extra_data, it had a _ in between, which was causing the issue so this is the corrected command
mongoimport --db mydb_backup --collection extradata --file '/Users/muskanmall/Desktop/updateddata.json' --dropAnother issue in MAC is using double quotes, sometimes Mac can't recognize double quotes, so put your pathing single quotes Ideally dont have any special characters in any of the names Hope it helps!