File tree Expand file tree Collapse file tree
java/io/ejangs/docsa/domain/doc/readmodel/document Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010import lombok .Getter ;
1111import lombok .NoArgsConstructor ;
1212import org .springframework .data .annotation .Id ;
13- import org .springframework .data .mongodb .core .index .Indexed ;
13+ import org .springframework .data .mongodb .core .index .CompoundIndex ;
14+ import org .springframework .data .mongodb .core .index .CompoundIndexes ;
1415import org .springframework .data .mongodb .core .mapping .Document ;
1516
1617@ Document ("doc_list_read_models" )
18+ @ CompoundIndexes ({
19+ @ CompoundIndex (
20+ name = "idx_doc_list_user_deleted_updated" ,
21+ def = "{'userId': 1, 'deleted': 1, 'updatedAt': -1}"
22+ ),
23+ @ CompoundIndex (
24+ name = "idx_doc_list_user_deleted_title" ,
25+ def = "{'userId': 1, 'deleted': 1, 'title': 1}"
26+ )
27+ })
1728@ Getter
1829@ NoArgsConstructor (access = AccessLevel .PROTECTED )
1930public class DocListReadModel {
2031
2132 @ Id
2233 private Long id ; // docId
2334
24- @ Indexed
2535 private Long userId ;
2636
2737 private String title ;
Original file line number Diff line number Diff line change 55 data :
66 mongodb :
77 uri : ${SPRING_DATA_MONGODB_URI:${MONGO_URI}}
8+ auto-index-creation : ${SPRING_DATA_MONGODB_AUTO_INDEX_CREATION:true}
89
910 mail :
1011 connection-timeout : 5000
You can’t perform that action at this time.
0 commit comments