File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
packages/compass-indexes/src Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -602,12 +602,15 @@ const fetchIndexes = (
602602 isReadonlyView,
603603 isWritable,
604604 namespace,
605+ serverVersion,
605606 searchIndexes : { status } ,
606607 } = getState ( ) ;
607608
608- if ( ! isWritable ) {
609- // remove is ReadOnlyBlocker,
610- return ;
609+ const mongoDBMajorVersion = parseFloat (
610+ serverVersion . split ( '.' ) . slice ( 0 , 2 ) . join ( '.' )
611+ ) ;
612+ if ( isReadonlyView || mongoDBMajorVersion < 8.1 || ! isWritable ) {
613+ return ; // fetch for views 8.1+
611614 }
612615
613616 // If we are already fetching indexes, we will wait for that
Original file line number Diff line number Diff line change @@ -156,7 +156,14 @@ export function activateIndexesPlugin(
156156 } ) ;
157157
158158 void store . dispatch ( fetchRegularIndexes ( ) ) ;
159- if ( options . isSearchIndexesSupported || options . isReadonly ) {
159+
160+ const mongoDBMajorVersion = parseFloat (
161+ options . serverVersion . split ( '.' ) . slice ( 0 , 2 ) . join ( '.' )
162+ ) ;
163+ if (
164+ options . isSearchIndexesSupported ||
165+ ( options . isReadonly && mongoDBMajorVersion > 8.0 )
166+ ) {
160167 void store . dispatch ( fetchSearchIndexes ( ) ) ;
161168 }
162169
You can’t perform that action at this time.
0 commit comments