mongo "mongodb+srv://sandbox-hoj54.mongodb.net/test" --authenticationDatabase admin --username m001-student --password m001-mongodb-basics
2020-06-19T14:18:02.553+0530 E 查询 [js] 未捕获的异常: 语法错误: 意外的令牌:字符串字面量 :
@(shell):1:6
连接到数据库有两个选项。使用mongo shell连接或连接您的应用程序。看起来你正在尝试通过shell连接。您可以在窗口中看到连接字符串:
MongoDB Atlas面板>集群>'连接'按钮。
当然,您必须按照说明替换<dbname>
和<password>
。