I'm wondering if it's possible to create a table dynamically in mongodb using a Mongoose schema, Node.js and Angular for example.
The basic way to make a schema is to create a model explicitly in Node.js like this:
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const postSchema = new Schema({
title: { type: 'String', required: true },
content: { type: 'String', required: true },
slug: { type: 'String', required: true }
});
let Post = mongoose.model('Post', postSchema);
Is it possible to create this schema dynamically by using the user input from an Angular frontend?