Docs Menu
Docs Home
/ /

데이터베이스에 Time Series 컬렉션 나열

데이터베이스에 컬렉션 목록을 출력하고 컬렉션 유형을 포함한 다양한 속성을 기준으로 결과를 필터링할 수 있습니다. 이 기능을 사용하여 데이터베이스의 모든 Time Series 컬렉션을 나열할 수 있습니다.

데이터베이스의 모든 Time Series 컬렉션을 나열하려면 listCollections 명령을 사용하고 { type: "timeseries" }에 대한 필터를 적용하세요

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
}

돌아가기

집계 및 연산자

이 페이지의 내용