使用rmongodb时,无法在mongoDB中看到集合 [英] When using rmongodb, unable to see collections in mongoDB

查看:155
本文介绍了使用rmongodb时,无法在mongoDB中看到集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到与此线程相同的问题:

I am having the same issue as in this thread:Unable to see collections in mongo DB when connected through R

我已成功连接到mongoDB.

I am successfully connected to mongoDB.

> mongo.is.connected(mongo)
[1] TRUE

如果运行以下代码,则会看到正确的数据库.

If I run the following code, I see the correct db.

> mongo.get.databases(mongo)
[1] "FF"
> 

但是,当我尝试查看集合时,它会返回character(0)

But, when I try to view the collections, it returns character(0)

> mongo.get.database.collections(mongo , db = "FF")
character(0)
>

如果我从外壳连接,则可以看到所有集合,因此我知道它们存在.

If I connect from the shell I can see all the collections, so I know they exist.

> use FF
switched to db FF

> show collections
kelp_classifications
kelp_groups
kelp_subjects
kelp_users

推荐答案

更新2017-09-25

rmongodb不再受支持并已从CRAN中删除

Update 2017-09-25

rmongodb is no longer supported and removed from CRAN

参考: https://github.com/dselivanov/rmongodb

此功能在v1.8.0中对我来说正常工作:

This function is working correctly for me in v1.8.0:

mongo <- mongo.create()
mongo.is.connected(mongo)
# [1] TRUE
db <- "test"
mongo.get.database.collections(mongo, db = db)
[1] "test.test"

这篇关于使用rmongodb时,无法在mongoDB中看到集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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