error parsing command line options: error parsing positional arguments: provide only one file name and only one MongoDB connection string. Connection strings must begin with mongodb:// or mongodb+srv:// schemes
How to fix this error
i tried to import a json file using
mongoimport json_path.json -d database_name -c collection_name
Hi @Harison_Lopez and @steevej! You can actually use either an = or a space between an option and its argument. Although the docs use = to be consistent, both are valid.
@Harison_Lopez this error occurs when the command sees two positional arguments (i.e. two strings not prefixed by an option like -c). Does the path to your file or your collection name include a space? A space in your file path or in another option argument will cause the part after the space to be parsed as an extra positional argument. In bash, you can fix this by putting quotes around your strings like this: