B
B
bogdansunsets2020-08-22 14:00:57
MongoDB
bogdansunsets, 2020-08-22 14:00:57

Need to display biography value from MongoDB Database using mongoose and NodeJS in modal window in PUG?

There is an object in the database, it has a biography item that stores the string value. It is necessary to pull out this very value from the database and display it in a modal window, in modal-content. I am new to learning Base. data and nodejs. Do I have the code below? Is it necessary to use a schema to bring this into a modal window?

This is the Schema code:

const characterSchema = new Schema({
  account: { type: Schema.Types.ObjectId, index: true, ref: 'Account' },
  site: { type: Schema.Types.ObjectId, ref: 'Auth' },
  name: { type: String, index: true },
  desc: String,
  tag: String,
  info: String,
  flags: { type: Number, default: 0 },
  lastUsed: { type: Date, index: true },
  creator: String,
  state: Object,
  biography: { type: String, index:true },
}, { timestamps: true });


Modal window PUG code:
.modal-overlay
                .modal
                    a.close-modal
                      svg(viewbox='0 0 20 20')
                        path()
                        // close modal
                    .modal-content
                        | There biography

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question