MongoDB / Mongoose timestamps not updating
<p>Schema:</p>

<pre><code>var schema = new Schema({...}, {
    timestamps: true,
    id: false,
    toJSON: {
        virtuals: true,
    },
    toObject: {
        virtual: true,
    }
});
schema.virtual('updated').get(function () {
    if(typeof this.updatedAt === "undefined" &amp;&amp; typeof this.createdAt === "undefined") return "";
    var updated = (typeof this.updatedAt === "undefined") ? this.createdAt : this.updatedAt;
    return "Updated "+moment(updated).fromNow();
});
</code></pre>

<p>This code <strong>was</strong> working recently - updatedAt for a particular instance comes up as August 24th, however any new edits to the document <strong>doesn't</strong> update the timestamp.</p>

<p>Feels like I'm missing something very silly here.</p>