Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. var userSchema = mongoose.Schema({
  2. userData: {
  3. name: { type: String, required: true, unique: true },
  4. password: String
  5. },
  6. notes: [ String ],
  7. contacts: [{
  8. name: String,
  9. notes: [ String ]
  10. }],
  11. locations: [ String ]
  12. });
  13.  
  14. each user in allUsers
  15. p #{user.userData.name}
  16.  
  17. app.get('/', function(req, res) {
  18. if (app.locals.userData.name) {
  19. res.render('app', {
  20. currentUser: app.locals.userData,
  21. allUsers: User.find({})
  22. });
  23. } else {
  24. res.redirect('signup');
  25. }
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement