데이터베이스에 Time Series 컬렉션 나열
데이터베이스에 컬렉션 목록을 출력하고 컬렉션 유형을 포함한 다양한 속성을 기준으로 결과를 필터링할 수 있습니다. 이 기능을 사용하여 데이터베이스의 모든 Time Series 컬렉션을 나열할 수 있습니다.
절차
데이터베이스의 모든 time series 컬렉션을 나열하려면 { type: "timeseries" }
필터와 함께 listCollections
명령을 사용합니다.
db.runCommand( { listCollections: 1, filter: { type: "timeseries" } } )
출력
Time series 컬렉션의 경우 출력에는 다음이 포함됩니다.
type: 'timeseries'
options: { timeseries: { ... } }
예를 들면 다음과 같습니다.
{ cursor: { id: Long("0"), ns: 'test.$cmd.listCollections', firstBatch: [ { name: 'weather', type: 'timeseries', options: { timeseries: { timeField: 'timestamp', metaField: 'metadata', granularity: 'hours', bucketMaxSpanSeconds: 2592000 } }, info: { readOnly: false } } ] }, ok: 1 }