updated dependecies, added context, axios config

This commit is contained in:
Ben Elferink
2021-03-13 17:46:51 +02:00
parent a895cc0647
commit bc37d68394
19 changed files with 39144 additions and 509 deletions

View File

@@ -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);