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

@@ -0,0 +1,28 @@
import mongoose from 'mongoose';
const instance = new mongoose.Schema(
{
/*
document ID is set by default via MongoDB - next line is deprecated
_id: mongoose.Schema.Types.ObjectId,
*/
// key: Type,
email: String,
password: String,
},
{
timestamps: true,
// ^ ^ ^ this creates and maintains:
// {
// createdAt: Date,
// updatedAt: Date,
// }
},
);
// NOTE! use a singular model name, mongoose automatically creates a collection like so:
// model: 'Account' === collection: 'accounts'
const modelName = 'Account';
export default mongoose.model(modelName, instance);