Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Duplicate request to database in ".find()" function when argument is array of id's #490

Closed
ZmeyPetrov opened this Issue · 4 comments

3 participants

ZmeyPetrov Túlio Ornelas Chris Heald
ZmeyPetrov

Code (Rails 3.2.11, mongo_mapper 0.12.0):

User.find(['id1','id2'])

In console get:

MONGODB (3.8ms) db_name['users'].find({:_id=>{"$in"=>[BSON::ObjectId('id1'), BSON::ObjectId('id2')]}})
MONGODB (3.1ms) db_name['users'].find({:_id=>{"$in"=>[BSON::ObjectId('id1'), BSON::ObjectId('id2')]}})

there are 2 same requests

there was no such behavior in mongo_mapper 0.11.2

it also take place in ".all" function

Túlio Ornelas

Its the same with ".where()":

User.where(:id.in => ["id1", "id2"]).to_a
Chris Heald
Owner

I'm unable to replicate this with MM 0.12.0 and plucky 0.6.2 - this feels like it would be more of a Plucky bug than a MM bug. What version of plucky do you guys have bundled?

ZmeyPetrov

I have plucky (0.5.2) bundled both on Windows 7 and Ubuntu 12.04

Chris Heald
Owner

I'm closing this as I'm confident that it's resolved on the latest plucky/MM master. Please re-open if you can replicate with those versions.

Chris Heald cheald closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.