|
Compound indexes build off the ascending and descending indexes idea. A createIndexes command on a time-series collection measurement field:
{
|
createIndexes: “abc”,
|
indexes: [ { key: { a : 1, b : 1 } } ]
|
}
|
|
will be equivalent to the following operation on the underlying buckets collection:
{
|
createIndexes: “system.buckets.abc”,
|
indexes: [
|
{ key: { control.max.a : 1, control.min.a : 1,
|
control.max.b : 1, control.min.b : 1 } }
|
]
|
}
|
Additionally, a createIndexes command on a time-series collection measurement field with both ascending and descending options:
{
|
createIndexes: “abc”,
|
indexes: [ { key: { a : 1, b : -1 } } ]
|
}
|
will be equivalent to the following operation on the underlying buckets collection:
{
|
createIndexes: “system.buckets.abc”,
|
indexes: [
|
{ key: { control.max.a : 1, control.min.a : 1,
|
control.min.b : -1, control.max.b : -1 } }
|
]
|
}
|
|
|