MongoDB Schema (properties/attributes?)

Hello,
It is me again, I have been going over mongodb and I want to say so far so good. For the life of me though I cant remember what these things are called, I tried googling but nothing comes up. Most likely, because I am not using the right word.
I will explain, the code I have right now is

const mongoose = require('mongoose');
main().catch(err => console.log(err));

async function main() {
  await mongoose.connect('mongodb://localhost:27017/courses')
  .then(()=> console.log('Connected to MongoDB...'))
  .catch((err) => console.error('Could not connect to MongoDB...', err));
}

const studentSchema = new mongoose.Schema({
    name: String,
    password: String,
    email: {
        type: String,
        trim: true,
        lowercase: true,
    }
});

I am making a student schema, and then a course schema. I am going through the email right now, and the code that says

trim:true

I for the life of me can not remember what that “trim” would be called. A property? attribute? I am just wondering because I want to look at a full list for other things I should add for that email

trim would be the “key” and true would be the “value”, properties are key/value pairs.

1 Like

Thank you, it was driving me crazy I could not remember.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.