File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -85,8 +85,9 @@ private async Task CreateCollectionAsync(string collectionName)
8585 private async Task CreateKustoExpireIndexKustoQueryRun ( string collectionName )
8686 {
8787 var builder = Builders < KustoQueryRun > . IndexKeys ;
88+ var keys = m_configs . WithCosmosDb ? builder . Ascending ( "_ts" ) : builder . Ascending ( x => x . ExecuteDateTimeUtc ) ;
8889 var indexModel = new CreateIndexModel < KustoQueryRun > (
89- builder . Ascending ( x => x . ExecuteDateTimeUtc ) ,
90+ keys ,
9091 new CreateIndexOptions
9192 {
9293 ExpireAfter = TimeSpan . FromDays ( 1 ) ,
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ public MongoConfiguration()
3333 [ Required ]
3434 public string DatabaseName { get ; set ; } = Environment . GetEnvironmentVariable ( "MONGO_DATABASE_NAME" ) ;
3535
36+ /// <summary>
37+ /// Gets or sets a value indicating whether cosmosdb is being used.
38+ /// </summary>
39+ public bool WithCosmosDb { get ; set ; } = Environment . GetEnvironmentVariable ( "MONGO_WITH_COSMOSDB" ) == "true" ;
40+
3641 /// <summary>
3742 /// Ensures that all required values are populated.
3843 /// </summary>
You can’t perform that action at this time.
0 commit comments