我正在使用最新版本的mongo驱动程序,并且正在尝试执行in查询。
这曾经是有效的,但由于某些原因现在不起作用了,我在驱动程序中寻找了$in的示例,但找不到任何东西。
Mongo::Logger.logger.level = ::Logger::FATAL
client = Mongo::Client.new([configatron.dbserver],
:database => configatron.dbname
)
@collection = client[collection_name]
@collection.find(
:$and => [
{:ShareIndex => {:$in => share_indexes}},
{:Latest => true}]
)我得到的确切错误是:
undefined method `bson_type' for #<Mongo::Collection::View:0x007ff9b2827130>发布于 2015-09-19 14:11:50
mongodb中没有$a运算符
@collection.find({ :ShareIndex => { :$in => share_indexes }, :Latest => true })https://stackoverflow.com/questions/32664797
复制相似问题