Answer the question
In order to leave comments, you need to log in
Information from mongodb not outputting to pug element?
There is a Biography key in the database schema, and we need to display it in the modal window of the PUG document. Nothing is output in PUG.
scheme:
const characterSchema = new Schema({
desc: String,
tag: String,
info: String,
creator: String,
state: Object,
account: {
type: Schema.Types.ObjectId,
index: true,
ref: 'Account'
},
site: {
type: Schema.Types.ObjectId,
ref: 'Auth'
},
name: {
type: String,
index: true
},
flags: {
type: Number,
default: 0
},
lastUsed: {
type: Date,
index: true
},
biography: {
type: String,
index: true
},
}, { timestamps: true });
export const Character = model<ICharacter>('Character', characterSchema);
export async function exportBiography(res:any, accountId: ID){
const modalb = await Character.findById(accountId);
res.render('index', { modalb: JSON.stringify(modalb) });
}
case PlayerAction.ShowModal:
app.get(this.client.accountId, (req: any, res: any) => {
exportBiography(res, req.parrams.id);
});
.modal-overlay
.modal
a.close-modal
svg(viewbox='0 0 20 20')
path()
// close modal
.modal-content
| {{modalb.biography}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question