Skip to content

Instantly share code, notes, and snippets.

@alcabanillas-engh
Created November 2, 2008 04:58
Show Gist options
  • Save alcabanillas-engh/21652 to your computer and use it in GitHub Desktop.
Save alcabanillas-engh/21652 to your computer and use it in GitHub Desktop.
##Model
class NpaNxx
include DataMapper::Resource
property :id, String, :key => true, :field => :_id, :serial => true
property :rev, String, :field => :_rev
property :npanxx, String, :view => true
property :region, String
property :ocn, String
property :ratecenter, String
property :exchange, String
property :company_name, String
#view :by_npanxx, { "map" => "function(doc) { if (doc.type == 'npa_nxx') { emit(doc.npanxx, doc); } }" }
end
##Code to find
npanxx = NpaNxx.get(:npanxx => "907209")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment