Question

I have a simple query:

Store.where( params[:conditions] || {}).all

In logs ,it appears that mongo mapper is firing the same query twice.

2013-07-28 14:01:05 - [DEBUG]:  MONGODB (0.7ms) db-development['stores'].find().
2013-07-28 14:01:05 - [DEBUG]:  MONGODB (0.5ms) db-development['stores'].find().

This seems like a bug to me. See also https://github.com/jnunemaker/mongomapper/pull/467.

Apparently, this bug still not fixed..

Does Anybody know how can I write the query with a single access to database?

UPDATE:

At gem list:

mongo_mapper (0.12.0)
plucky (0.5.2)

Thanks!!

Was it helpful?

Solution

This is a known bug with Plucky 0.5.2. Try upgrading to MM 0.13.0.beta1, or using MM's master.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top