@@ -26,24 +26,25 @@ module.exports = function (app) {
26
26
} ) ;
27
27
28
28
const contributions = new mongooseClient . Schema ( {
29
- userId : { type : String , required : true } ,
30
- categoryIds : { type : Array } ,
29
+ userId : { type : String , required : true , index : true } ,
30
+ categoryIds : { type : Array , index : true } ,
31
31
title : { type : String , required : true } ,
32
32
// Generated from title
33
- slug : { type : String , required : true , unique : true } ,
34
- type : { type : String , required : true } ,
33
+ slug : { type : String , required : true , unique : true , index : true } ,
34
+ type : { type : String , required : true , index : true } ,
35
35
cando : candoSchema ,
36
36
content : { type : String , required : true } ,
37
37
// Generated from content
38
38
contentExcerpt : { type : String , required : true } ,
39
39
teaserImg : { type : String } ,
40
- language : { type : String , required : true } ,
41
- shoutCount : { type : Number , default : 0 } ,
40
+ language : { type : String , required : true , index : true } ,
41
+ shoutCount : { type : Number , default : 0 , index : true } ,
42
42
meta : metaSchema ,
43
43
visibility : {
44
44
type : String ,
45
45
enum : [ 'public' , 'friends' , 'private' ] ,
46
- default : 'public'
46
+ default : 'public' ,
47
+ index : true
47
48
} ,
48
49
isEnabled : {
49
50
type : Boolean ,
@@ -75,7 +76,7 @@ module.exports = function (app) {
75
76
}
76
77
}
77
78
} ,
78
- deleted : { type : Boolean , default : false } ,
79
+ deleted : { type : Boolean , default : false , index : true } ,
79
80
createdAt : { type : Date , default : Date . now } ,
80
81
updatedAt : { type : Date , default : Date . now } ,
81
82
wasSeeded : { type : Boolean }
0 commit comments