updated dependecies, added context, axios config
This commit is contained in:
@@ -2,17 +2,18 @@ import mongoose from 'mongoose';
|
||||
|
||||
const instance = new mongoose.Schema(
|
||||
{
|
||||
_id: mongoose.Schema.Types.ObjectId, // _id is set by default, (you can remove this line)
|
||||
|
||||
/*
|
||||
name = Object key
|
||||
String = Type
|
||||
document ID is set by default via MongoDB - next line is deprecated
|
||||
_id: mongoose.Schema.Types.ObjectId,
|
||||
*/
|
||||
name: String,
|
||||
|
||||
// key: Type,
|
||||
email: String,
|
||||
password: String,
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
// this creates and maintains:
|
||||
// ^ ^ ^ this creates and maintains:
|
||||
// {
|
||||
// createdAt: Date,
|
||||
// updatedAt: Date,
|
||||
@@ -21,7 +22,7 @@ const instance = new mongoose.Schema(
|
||||
);
|
||||
|
||||
// NOTE! use a singular model name, mongoose automatically creates a collection like so:
|
||||
// model: 'User' === collection: 'users'
|
||||
const modelName = 'User';
|
||||
// model: 'Account' === collection: 'accounts'
|
||||
const modelName = 'Account';
|
||||
|
||||
export default mongoose.model(modelName, instance);
|
||||
Reference in New Issue
Block a user