Roland Tanglao
About

How to convert MongoDB cursor or result iterator to an array in Ruby: use 'to_a()'

Apr 17, 2018

Pontifications

  • Example in ruby from read-reviews-replies.rb :
 result_array = reviewsColl.find(
   { 'id' => r1["id"] }).update_one(
     r1, :upsert => true ).to_a

Leave a comment on github

Roland Tanglao

  • Roland Tanglao
  • roland@rolandtanglao.com
  • rtanglao
  • rtanglao

flickr.com/roland, twitter.com/rtanglao #firefox #thunderbird