Skip to content

Commit

Permalink
test wip: add composite index while creating a container
Browse files Browse the repository at this point in the history
  • Loading branch information
pranshi06 committed Mar 26, 2024
1 parent a17d721 commit 0bd445c
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions script/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,62 @@ const { database } = await cosmosClient.databases.createIfNotExists({
paths: [
'/year'
]
},
indexingPolicy: {
automatic: true,
indexingMode: "consistent",
includedPaths: [
{
path: "/*"
}
],
excludedPaths: [
{
path: "/\"_etag\"/?"
}
],
compositeIndexes: [
[
{
"path": "/overallMotivation",
"order": "descending"
},
{
"path": "/prize_id",
"order": "descending"
}
],
[
{
"path": "/overallMotivation",
"order": "ascending"
},
{
"path": "/prize_id",
"order": "descending"
}
],
[
{
"path": "/year",
"order": "ascending"
},
{
"path": "/prize_id",
"order": "ascending"
}
],
[
{
"path": "/year",
"order": "ascending"
},
{
"path": "/prize_id",
"order": "descending"
}
]
]
}
})

Expand Down

0 comments on commit 0bd445c

Please sign in to comment.