I have the following document schema:
var pageSchema = new Schema({
name: String
, desc: String
, url: String
})
Now, in my application I would like to also have the html source of the page inside the object, but I do not want to store it in the db.
Should I create a "local" enhanced object which has a reference to the db document?
function Page (docModel, html) {
this._docModel = docModel
this._html = html
}
Is there a way to use the document model directly by adding a "virtual" field?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…