- MapReduce is a two step process
- reduce function takes output of maps and collections and aggregates then gives you it in a collection
- http://www.mongodb.org/display/DOCS/MapReduce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ** Invoke release (first_time) | |
| ** Execute release | |
| rake aborted! | |
| undefined method `grep' for "engineyard-serverside-adapter (1.4.0)\n":String | |
| /Users/danishkhan/Projects/engineyard/Rakefile:40:in `bump_serverside_adapter' | |
| /Users/danishkhan/Projects/engineyard/Rakefile:76:in `block in <top (required)>' | |
| /Users/danishkhan/.rvm/gems/ruby-1.9.2-p136@global/gems/rake-0.8.7/lib/rake.rb:636:in `call' | |
| /Users/danishkhan/.rvm/gems/ruby-1.9.2-p136@global/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute' | |
| /Users/danishkhan/.rvm/gems/ruby-1.9.2-p136@global/gems/rake-0.8.7/lib/rake.rb:631:in `each' | |
| /Users/danishkhan/.rvm/gems/ruby-1.9.2-p136@global/gems/rake-0.8.7/lib/rake.rb:631:in `execute' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OVERWRITE=true ADMIN_NAME=admin ADMIN_USERNAME=admin ADMIN_PASSWORD=eypass DATABASE_TEMPLATE=styled-blog.yml rake db:bootstrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SalesController < ApplicationController | |
| include CsvMapper | |
| def csv_import | |
| results = CsvMapper.import(params[:dump][:file].original_filename) do | |
| map_to Sale | |
| after_row lambda{|row, sale| sale.save } | |
| start_at_row 1 | |
| [start_date, country] |
NewerOlder