mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Improved Article model
This commit is contained in:
+10
-7
@@ -4,23 +4,26 @@ const db = conn.getDB("gohcms")
|
||||
db.createCollection('articles', {
|
||||
validator: {
|
||||
$jsonSchema: {
|
||||
required: ['content', 'date', 'id_name', 'page_id', 'online'],
|
||||
required: ['titleID', 'title', 'content', 'date', 'tags', 'online'],
|
||||
properties: {
|
||||
_id: {
|
||||
bsonType: 'objectId'
|
||||
},
|
||||
titleID: {
|
||||
bsonType: 'string',
|
||||
pattern: '^[-a-z]+$'
|
||||
},
|
||||
title: {
|
||||
bsonType: 'string'
|
||||
},
|
||||
content: {
|
||||
bsonType: 'object'
|
||||
},
|
||||
date: {
|
||||
bsonType: 'number'
|
||||
},
|
||||
id_name: {
|
||||
bsonType: 'string',
|
||||
pattern: '^.+$'
|
||||
},
|
||||
page_id: {
|
||||
bsonType: 'string'
|
||||
tags: {
|
||||
bsonType: 'array'
|
||||
},
|
||||
online: {
|
||||
bsonType: 'bool'
|
||||
|
||||
Reference in New Issue
Block a user