I have this Schema: (I am working with MEAN stack)
var userSchema = mongoose.Schema({
firstName: String,
lastName: String,
randomText: String
});
var User = mongoose.model('User', userSchema);
A jade file:
.someClass Some default text
input.form-control.yfname(type="text", ng-model="user.firstName")
input.form-control.ylname(type="text", ng-model="user.lastName")
button Register
I want when I click Register button , whatever firstName and lastName is entered , to be saved to the database and the text from .someClass to be stored in the randomText field. Also I want to be able to find it later with db.collection.find but I am not sure how. Help is greatly appreciated :)