Quantcast
Channel: Mongo – Running with Ruby
Browsing all 14 articles
Browse latest View live

How to use Ransack helpers with MongoDB and Mongoid on Rails 4.0

Ransack is a rewrite of MetaSearch. It allows you to create search forms and sorting for your ActiveRecord data. Somehow I really miss that, when working with Mongoid. To be honest I can even live...

View Article



State machine gem: undefined method underscore for ActiveModel::Name

If  you encounter this issue: When using state machine, machinist and machinist_mongo, please add this to your app/config/initializers/state_machine.rb: This should be enough to make it work :)

View Article

MongoDB: Mongodump terminate called after throwing an instance of...

If you encounter this error: Please add this either in the console (for current session) or in .bashrc file. After that you should be ready to go with:

View Article

Using multiple MongoDB databases instead of one – performance check

I’m starting to develop a new application. Can’t say what it is, but it perfectly fits MongoDB Document Oriented Database approach. Everything is great. except of small detail – I don’t want to store...

View Article

Ruby, Rails + objects serialization (Marshal), Mongoid and performance matters

Introduction Sometimes, we want to store our objects in files/database directly (not ORmapped or DRmapped). We can obtain this with serialization. This process will convert any Ruby object into format...

View Article


Mongoid: Serialize to JSON with an string id attribute

A quick hint, on how to have an ‘id’ attribute in Mongoid document JSON: When you serialize Mongoid objects to JSON, you won’t get ID attribute, similar to ActiveRecord. Instead you’ll have “_id”...

View Article

Learning Mongoid – Build scalable, efficient Rails web applications with...

First of all I will point one thing: I’m not a professional book reviewer. I don’t do this too often. Probably because I don’t have enough time. However, I’ve decided to do a review of “Learning...

View Article

Mongoid and Aggregation Framework: Get similar elements based on tags,...

So, lets say we want have an Article model with tags array: Let’s try to pick any similar first (without similarity level) We have an article, that has some tags (%w{ ruby rails mongoid mongodb }) and...

View Article


MongoDB monitoring with Munin – Setting up Munin to work with MongoDB

To monitor MongoDB you can use many tools, some like MongoDB Management Service (MMS) are cloud based, some like Munin might be installed locally. Today we will focus on setting up Munin to monitor...

View Article


Mongoid (MongoDB) has_many/belongs_to relation and wrong index being picked

Sometimes when you have a belongs_to relations, you may notice, that getting an owner object can be really slow. Even if you add index like this: Mongoid might not catch it. Unfortunately you can’t...

View Article

Mongoid, Kaminari i Padrino (Sinatra)

Część z Was już pewnie zauważyła, że w nowej wersji Mongoida (2.0.2) zrezygnowano z will_paginate. Will_paginate okazał się niezbyt efektywny, ponieważ nie obsługiwał opcji limit i kilku innych rzeczy,...

View Article

Ruby, Mongoid and memory leaks – Identity map problem

Where is my memory? Recently, when browsing large dataset from MongoDB using Padrino and Thin, Ruby started to have memory leaks. After each request it grew approximately 2-5 MB. I’ve started debugging...

View Article

Image may be NSFW.
Clik here to view.

Ruby, Mongoid and (again) memory leaks – next Identity map problem

Lately I’ve fixed an issue with Mongoid driver (read more about this). Memory consumption stabilized at a relatively low level until… gem update mongo. Below you can see Munin memory and CPU...

View Article


Using MongoDB to store and retrieve CSV files content in Ruby

There come cases, when we want to store CSV or any other sort of files data in a database. The problem occurs when the input files differs (they might have different columns). This would not be a...

View Article
Browsing all 14 articles
Browse latest View live




Latest Images