# Dynamically defining properties >> class Mocha < RelaxDB::Document; end >> Mocha.new.save >> m = Mocha.new >> m.class.instance_eval { property :shot } >> m.shot = "strong" >> m.save >> Mocha.all => [#, #] # Dynamically defining properties - another approach Mocha.module_eval { property :chilled } # Parameterizing a view request @cds = Cd.all.sorted_by(:year_of_release) { |q| q.startkey(2005).descending(true) } # Updating and saving @cd.set_attributes(params[:cd]) # The following might be a little more succinct, but # you'd need to pass the document revision to the web client Cd.new(params[:cd]).save