Skip to content

Instantly share code, notes, and snippets.

@timhudson
Created October 28, 2013 17:38
Show Gist options
  • Select an option

  • Save timhudson/7201169 to your computer and use it in GitHub Desktop.

Select an option

Save timhudson/7201169 to your computer and use it in GitHub Desktop.
var resourceModels = {}
function getModel(app) {
if (resourceModels[app]) return resourceModels[app]
return resourceModels[app] = mongoose.model('resource'+app, schema)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment