How to conver JSON collection into Hash using Rails 3 -


i having json collection fetched mongodb & want convert hash.

how can so..?

thanks in advance..

how did fetch mongo? ruby mongo driver automatically gives ruby hashes.

edit: take second question account

in mongo, queries don't execute until call requires them execute. before call to_json, still playing query object.

instead of to_json, try using to_a array of hashes back.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -