New 'users' collection for auth

This commit is contained in:
Florian Sylvain
2022-10-19 22:46:29 +02:00
parent 351b8af31b
commit 5b284b1839
+21 -2
View File
@@ -1,5 +1,5 @@
conn = new Mongo() const conn = new Mongo()
db = conn.getDB("gohcms") const db = conn.getDB("gohcms")
db.createCollection('articles', { db.createCollection('articles', {
validator: { validator: {
@@ -23,3 +23,22 @@ db.createCollection('articles', {
} }
} }
}) })
db.createCollection('users', {
validator: {
$jsonSchema: {
required: ['email', 'password'],
properties: {
_id: {
bsonType: 'objectId'
},
email: {
bsonType: 'string'
},
password: {
bsonType: 'string'
}
}
}
}
})