mongodb index properties
-
MongoDB - index (2)mongoDB 2022. 5. 29. 18:49
2022.04.17 - [mongoDB] - MongoDB - index (1) 에 이어서 작성하도록 하겠다. Index properties index에는 여러 property들이 있는데 이에 대해 간단하게 설명하도록 하겠다. TTL Indexes 정해진 시간 이후에 자동으로 document를 지울 때 사용하는 index이다. (만약 timeseries collection을 사용한다면 index가 아닌 collection의 option에 expireAfterSeconds를 추가해야한다.) db.eventlog.createIndex( { "lastModifiedDate": 1 }, { expireAfterSeconds: 3600 } ) Replica Set의 경우에는 TTL background thread..