1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-19 14:51:28 +00:00

Added in the admin page

This commit is contained in:
Scott Tolksdorf
2016-01-06 20:04:45 -05:00
parent 25b53a7c24
commit 46186c0de2
11 changed files with 224 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
var mongoose = require('mongoose');
var shortid = require('shortid');
var _ = require('lodash');
var HomebrewSchema = mongoose.Schema({
shareId : {type : String, default: shortid.generate},
@@ -7,15 +8,13 @@ var HomebrewSchema = mongoose.Schema({
text : {type : String, default : ""},
createdAt : { type: Date, default: Date.now },
updatedAt : { type: Date}
updatedAt : { type: Date},
lastViewed : { type: Date},
views : {type:Number, default:0}
});
//Schema Options
HomebrewSchema.pre('save', function(done) {
this.updatedAt = new Date();
done();
});
/*
HomebrewSchema.options.toJSON.transform = function (doc, ret, options) {