mongoexport E QUERY语法错误:意外的标识符 [英] mongoexport E QUERY SyntaxError: Unexpected identifier

查看:471
本文介绍了mongoexport E QUERY语法错误:意外的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题似乎很简单。我有一个数据库(测试)和一个名为(users)的集合,所以我运行命令:

  mongoexport -d test -c用户-o output.json 

但是我收到以下错误:




$ b $根据我到目前为止在互联网上已经知道,这可能与文件路径有关,但我不确定如何修改这个,因为我从来没有混淆PATH变量,因为一个糟糕的经验..

解决方案

你不会从mongo shell运行mongoexport,你必须从操作系统shell运行它(和你一样)运行mongo)


The issue seems straight forward. I have a database (test) and a collection called (users) so I run the command:

mongoexport -d test -c users -o output.json

However I get the below error:

As per what I have figured out till now over the internet, this may have something to do with the file path but I am unsure as how to amend this as I never mess with PATH variable due to a bad experience...

解决方案

You don't run mongoexport from the mongo shell, you have to run it from the OS shell (same as you run mongo)

这篇关于mongoexport E QUERY语法错误:意外的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆