xxxxxxxxxx
ubuntu2 config --default-user root
#ubuntu 20.04
ubuntu2004 config --default-user root
#ubuntu 18.04
ubuntu1804 config --default-user root
For windows terminal preview I had to change the command line to add the user in the default profile
xxxxxxxxxx
C:\WINDOWS\system32\wsl.exe -d Arch -u myusername
xxxxxxxxxx
// Using Node.js `require()`
const mongoose = require('mongoose');
// Using ES6 imports
import mongoose from 'mongoose';
xxxxxxxxxx
const Comment = new Schema({
name: { type: String, default: 'hahaha' },
age: { type: Number, min: 18, index: true },
bio: { type: String, match: /[a-z]/ },
date: { type: Date, default: Date.now },
buff: Buffer
});
// a setter
Comment.path('name').set(function(v) {
return capitalize(v);
});
// middleware
Comment.pre('save', function(next) {
notify(this.get('email'));
next();
});