mongodb查询数字开头的集合报错
2015-08-19 16:06
465 查看
mongodb查询数字开头的集合报错
mongo库中有数字开头的集合
进行查询
> db.2015BthSpecialAction.find()db.2015BthSpecialAction.find()
Wed Aug 19 16:03:30 SyntaxError: missing ; before statement (shell):1
试了“”还是报错
> db."2015BthSpecialAction".find({ }).limit(50) db."2015BthSpecialAction".find({ }).limit(50)
Wed Aug 19 16:04:19 SyntaxError: missing name after . operator (shell):1
查询资料使用["collection name"] 就可以
> db["2015BthSpecialAction"].findOne()db["2015BthSpecialAction"].findOne()
{
"_id" : ObjectId("5563de68da0a123513c743a2"),
"userId" : "4931368",
"time" : "2015-05-26 10:46:00"
}
用mongoexport 导出 -c 指定不会报错
./mongoexport -d actionsCache -c 2015BthSpecialAction --csv -f userId,time -o user_csv.csv
mongo库中有数字开头的集合
进行查询
> db.2015BthSpecialAction.find()db.2015BthSpecialAction.find()
Wed Aug 19 16:03:30 SyntaxError: missing ; before statement (shell):1
试了“”还是报错
> db."2015BthSpecialAction".find({ }).limit(50) db."2015BthSpecialAction".find({ }).limit(50)
Wed Aug 19 16:04:19 SyntaxError: missing name after . operator (shell):1
查询资料使用["collection name"] 就可以
> db["2015BthSpecialAction"].findOne()db["2015BthSpecialAction"].findOne()
{
"_id" : ObjectId("5563de68da0a123513c743a2"),
"userId" : "4931368",
"time" : "2015-05-26 10:46:00"
}
用mongoexport 导出 -c 指定不会报错
./mongoexport -d actionsCache -c 2015BthSpecialAction --csv -f userId,time -o user_csv.csv
相关文章推荐
- 使用Kettle抽取MongoDB数据到Oracle
- MongoVUE下实现MongoDB的Group分组查询
- MongoDB---性能优化---(1)
- MongoDB之备份与恢复
- Mongodb在Linux下的安装和启动和配置
- Node.js开发入门—用MongoDB改造LoginDemo
- 虚拟机安装的mongodb无法连接
- MongoDB基本使用
- Cloud Insight 数据管理平台 Beta 版上线
- MongoDB数据库设计法则---part 1
- MongoDB之聚合
- hadoop2.7.1+nutch2.3+mongodb+solr5.2.1的单机配置
- mongoDB分组
- nagios check_mongodb插件监控mongodb
- mongodb 示例
- Node.js开发入门——MongoDB与Mongoose
- MongoDB 重启之后无法连接问题
- CentOS 7下安装MongoDB
- mongodb用户权限管理
- mongodb安装