Commit faa3b1c 1 parent 88e26f8 commit faa3b1c Copy full SHA for faa3b1c
File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
const { MongoClient, ObjectID } = require ( 'mongodb' ) ;
2
2
const ArgParser = require ( './ArgParser' ) ;
3
+ const { logger } = require ( './Utils' ) ;
3
4
4
5
let db ;
5
6
( async function ( ) {
@@ -33,6 +34,22 @@ let db;
33
34
// do nothing. The collection may already exist
34
35
}
35
36
}
37
+ const testResultsDB = db . collection ( 'testResults' ) ;
38
+
39
+ const parentIdIndex = await testResultsDB . createIndex ( { parentId : 1 } ) ;
40
+ logger . info ( 'Index created: ' , parentIdIndex ) ;
41
+ const urlBuildNameBuildNumIndex = await testResultsDB . createIndex ( {
42
+ url : 1 ,
43
+ buildName : 1 ,
44
+ buildNum : 1 ,
45
+ } ) ;
46
+ logger . info ( 'Index created: ' , urlBuildNameBuildNumIndex ) ;
47
+
48
+ const result = await testResultsDB . listIndexes ( ) . toArray ( ) ;
49
+ logger . info ( 'Existing testResults indexes:' ) ;
50
+ for ( const doc of result ) {
51
+ logger . info ( doc ) ;
52
+ }
36
53
} ) ( ) ;
37
54
38
55
class Database {
You can’t perform that action at this time.
0 commit comments