rmongodb: using $or in query

后端 未结 4 1585
离开以前
离开以前 2020-12-21 17:40

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         


        
4条回答
  •  礼貌的吻别
    2020-12-21 17:57

    your way of creating an mongo bson array is wrong. You are missing the parts

    mongo.bson.buffer.start.object(buf, "0")
    ...
    mongo.bson.buffer.finish.object(buf)
    mongo.bson.buffer.start.object(buf, "1")
    ...
    mongo.bson.buffer.finish.object(buf)
    

    For a working example please check the latest comment on: https://github.com/mongosoup/rmongodb/issues/17

    I hope this works for now.

    There is a bug in all the .to.list / .from.list / .append.list commands. I am working on an easier solution!

提交回复
热议问题