Answer the question
In order to leave comments, you need to log in
How to add custom fields to MongoDB collection?
Hello! I ran into a problem that I don't know how to add custom fields to the collection.
In general, the essence is as follows.
I am writing an application for honey. document flow. There is a collection of patients, they have default fields. for them I created a model
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var schema = new Schema({
firstName: {type: String},
lastName: {type: String},
email: {type: String},
phone: {type: String},
adress: {type: String}
});
module.exports = mongoose.model('Patient', schema);
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var schema = new Schema({
inputName: {type: String}
});
module.exports = mongoose.model('Input', schema);
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