rmongodb

rmongodb: using $or in query

前提是你 提交于 2019-11-28 10:10:08
问题 I'm struggling to create a query using $or within R and rmongodb. What I'd like to emulate is this from cmdline mongo: db.people.find( { $or : [ {"person.cell": { $exists : true } }, {"person.home": { $exists : true } } ] }) I'd like to pull records where either person.cell is not null, or person.home is not null. I can query each individually, but cannot get data back when I create the buffer in rmongodb with the $or, the R code using rmongodb looks like this: l <- list("$exists"="true") buf

When using rmongodb, unable to see collections in mongoDB

情到浓时终转凉″ 提交于 2019-11-27 07:33:38
问题 I am having the same issue as in this thread:Unable to see collections in mongo DB when connected through R 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" > 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

Multiple use of the positional `$` operator to update nested arrays

帅比萌擦擦* 提交于 2019-11-26 13:49:50
This question is closely related to this one and I will consider the advice given with respect to schema design in a NoSQL context, yet I'm curious to understand this: Actual questions Suppose you have the following document: _id : 2 abcd name : 2 unittest.com paths : 4 0 : 3 path : 2 home queries : 4 0 : 3 name : 2 query1 url : 2 www.unittest.com/home?query1 requests: 4 1 : 3 name : 2 query2 url : 2 www.unittest.com/home?query2 requests: 4 Basically, I'd like to know if it is possible to use MongoDB's positional $ operator ( details ) multiple times, or put differently, in update scenarios

Multiple use of the positional `$` operator to update nested arrays

[亡魂溺海] 提交于 2019-11-26 03:43:55
问题 This question is closely related to this one and I will consider the advice given with respect to schema design in a NoSQL context, yet I\'m curious to understand this: Actual questions Suppose you have the following document: _id : 2 abcd name : 2 unittest.com paths : 4 0 : 3 path : 2 home queries : 4 0 : 3 name : 2 query1 url : 2 www.unittest.com/home?query1 requests: 4 1 : 3 name : 2 query2 url : 2 www.unittest.com/home?query2 requests: 4 Basically, I\'d like to know if it is possible to