Skip to content

Commit

Permalink
Admin+ _since for Groups
Browse files Browse the repository at this point in the history
Applies to OpenUserJS#93
  • Loading branch information
Martii committed Feb 6, 2019
1 parent 290ab64 commit 6f20908
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ var groupSchema = new Schema({
size: { type: Number, default: 0 }
});

groupSchema.virtual('_since').get(function () {
return this._id.getTimestamp();
});

var Group = mongoose.model('Group', groupSchema);

exports.Group = Group;

0 comments on commit 6f20908

Please sign in to comment.