Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. var siteSchema = new Schema({
  2. "company_url": {type: String, trim: true, index: true, unique: true, required: true, dropDups: true },
  3. "angellist_url": {type: String, trim: true },
  4. "product_desc": {type: String, trim: true },
  5. "blog_url": {type: String, trim: true },
  6. "video_url": {type: String, trim: true },
  7. "crunchbase_url": {type: String, trim: true },
  8. "name": {type: String, trim: true },
  9. "high_concept": {type: String, trim: true},
  10. "logo_url": {type: String, trim: true},
  11. "twitter": {type: String, trim: true},
  12. 'user_favs': [{type: Schema.Types.ObjectId, ref: 'User'}],
  13. "feature_date": {type: Date},
  14. "active": {type: Boolean}
  15. });
  16.  
  17. var site_id = req.params.site_id;
  18. Site.find({_id:site_id}, function(err, site){
  19. console.log(req.user_id);
  20. site.user_favs.push({_id: req.user._id});
  21. site.save( function(err, site_res){
  22. res.send([err,site_res]);
  23. });
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement