Just as the title suggests. I am not able to find anything related to Mongoid 3. The things I found only apply to old versions of mongoid
that didn't use Moped
.
I found this and it doesn't work:
def self.install_javascript
getWeekJs = Rails.root.join("lib/javascript/getWeek.js")
if collection.master['system.js'].find_one({'_id' => "getWeek"}).nil?
collection.master.db.add_stored_function("getWeek", File.new(getWeekJs).read)
end
end
This method would add a getWeek function to the system.js collection.
How can this be done in mongoid 3?