Last active
December 25, 2015 06:49
-
-
Save cranic/6935418 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Agenda = function(usuario){ | |
var schema = new mongoose.Schema({ | |
nome: 'string', | |
sobrenome: 'string' | |
}); | |
// O terceiro argumento serve para especificar o nome da collection | |
return mongoose.model('agenda_' + usuario, schema, 'agenda_' + usuario); | |
} | |
module.exports = Agenda; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment