@@ -1988,10 +1988,12 @@ describe('Shell API (integration)', function() {
1988
1988
const planCache = collection . getPlanCache ( ) ;
1989
1989
const res = await planCache . list ( [ { $project : { createdFromQuery : 1 , queryHash : 1 } } ] ) ;
1990
1990
expect ( res ) . to . deep . equal ( [
1991
- { createdFromQuery : { query : { quantity : { $gte : 5 } , type : 'apparel' } , sort : { } , projection : { } } , queryHash : '4D151C4C' } ,
1992
- { createdFromQuery : { query : { quantity : { $gte : 20 } } , sort : { } , projection : { } } , queryHash : '23B19B75' } ,
1993
- { createdFromQuery : { query : { item : 'abc' , price : { $gte : 5 } } , sort : { } , projection : { } } , queryHash : '117A6B10' } ,
1994
- { createdFromQuery : { query : { item : 'abc' , price : { $gte : 10 } } , sort : { } , projection : { } } , queryHash : '117A6B10' }
1991
+ // We do not test for the exact query hashes here, as they can vary between
1992
+ // server versions. Hashes for queries 3 and 4 are always equal currently.
1993
+ { createdFromQuery : { query : { quantity : { $gte : 5 } , type : 'apparel' } , sort : { } , projection : { } } , queryHash : `${ res [ 0 ] . queryHash } ` } ,
1994
+ { createdFromQuery : { query : { quantity : { $gte : 20 } } , sort : { } , projection : { } } , queryHash : `${ res [ 1 ] . queryHash } ` } ,
1995
+ { createdFromQuery : { query : { item : 'abc' , price : { $gte : 5 } } , sort : { } , projection : { } } , queryHash : `${ res [ 2 ] . queryHash } ` } ,
1996
+ { createdFromQuery : { query : { item : 'abc' , price : { $gte : 10 } } , sort : { } , projection : { } } , queryHash : `${ res [ 2 ] . queryHash } ` }
1995
1997
] ) ;
1996
1998
} ) ;
1997
1999
} ) ;
0 commit comments