Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var siteSchema = new Schema({
- "company_url": {type: String, trim: true, index: true, unique: true, required: true, dropDups: true },
- "angellist_url": {type: String, trim: true },
- "product_desc": {type: String, trim: true },
- "blog_url": {type: String, trim: true },
- "video_url": {type: String, trim: true },
- "crunchbase_url": {type: String, trim: true },
- "name": {type: String, trim: true },
- "high_concept": {type: String, trim: true},
- "logo_url": {type: String, trim: true},
- "twitter": {type: String, trim: true},
- 'user_favs': [{type: Schema.Types.ObjectId, ref: 'User'}],
- "feature_date": {type: Date},
- "active": {type: Boolean}
- });
- var site_id = req.params.site_id;
- Site.find({_id:site_id}, function(err, site){
- console.log(req.user_id);
- site.user_favs.push({_id: req.user._id});
- site.save( function(err, site_res){
- res.send([err,site_res]);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement