Ruby on Rails Tuesday, February 26, 2013

Jordon Bedwell wrote in post #1099153:
> On Tue, Feb 26, 2013 at 10:22 AM, Edward Stembler <lists@ruby-forum.com>
> wrote:
>> I have a mongo collection in Rails where I use it this manner:
>>
>> collection.find(selector, options).to_a
>>
>> I have around 47K rows of data, and it seems very slow doing it this
>> way.
>>
>> Should I be using the cursor instead of converting to an array? If so,
>> can anyone point me to the usage pattern? Or, is using to_a fine? Just
>> wondering if converting to an array is too slow.
>
> How about you tell us what ODM you are using?

I'm not sure what ODM stands for. I'm using the standard ruby driver for
mongo; not MongoMapper or Mongoid.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment