Skip to content

Instantly share code, notes, and snippets.

View EdinaVath's full-sized avatar

Edina EdinaVath

  • Salesforce
View GitHub Profile
@kinopyo
kinopyo / gist:1547098
Created January 1, 2012 11:36
MongoMapper query for not null column.

Goal

"Using MongoMapper to find all users that :name column is not null", this is all I want.

Solution

To do so, use this query:

User.where(:name.ne => nil).all
User.all(:name.ne => nil)