ruby on rails - MySQL to MongoDB conversion -


how convert following mongodb query ?

sets_progress = photo.select('count(status) count, status, photoset_id')                      .where('photoset_id in (?)', sets_tracked_array)                      .group('photoset_id, status') 

there no 1 1 mapping of sql query nosql implementation. you'll need precalculate data match way want access data.

if small enough, query need change map-reduce job. more here: http://www.mongodb.org/display/docs/mapreduce

here's decent tutorial takes query group's , converts map-reduce: http://www.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -