That's what I thought. However, "name" is being set in MongoDB instead of "n":
class Person
include Mongoid::Document
field :name, :as => :n
end
ruby-1.9.2-p0 > Person.create :name => 'nick'
=> #<Person _id: 4d4b07488533c594f5000001, name: "nick">
ruby-1.9.2-p0 >
ruby-1.9.2-p0 > Person.create :n => 'alex'
=> #<Person _id: 4d4b07518533c594f5000002, name: "alex">
ruby-1.9.2-p0 >
> db.people.find()
{ "_id" : ObjectId("4d4b07488533c594f5000001"), "name" : "nick" }
{ "_id" : ObjectId("4d4b07518533c594f5000002"), "name" : "alex" }
>
Unless....the value specified for :as is meant to be the human-friendly alias!
Thanks, mate. I got it all working.