Cleaned, refactored, added db init script

This commit is contained in:
Florian Sylvain
2022-10-14 09:14:45 +02:00
parent 0835726beb
commit 68495b6430
8 changed files with 285 additions and 190 deletions
+25
View File
@@ -0,0 +1,25 @@
conn = new Mongo()
db = conn.getDB("gohcms")
db.createCollection('articles', {
validator: {
$jsonSchema: {
required: ['content', 'date', 'id_name'],
properties: {
_id: {
bsonType: 'objectId'
},
content: {
bsonType: 'object'
},
date: {
bsonType: 'number'
},
id_name: {
bsonType: 'string',
pattern: '^.+$'
}
}
}
}
})