@@ -1242,10 +1242,6 @@ public function createCollection(string $id, array $attributes = [], array $inde
12421242
12431243 $ isArray = $ collectionAttribute ->getAttribute ('array ' , false );
12441244 if ($ isArray ) {
1245- if (!$ this ->adapter ->getSupportForIndexArray ()) {
1246- throw new IndexException ('Indexing an array attribute is not supported ' );
1247- }
1248-
12491245 if ($ this ->adapter ->getMaxIndexLength () > 0 ) {
12501246 $ lengths [$ i ] = self ::ARRAY_INDEX_LENGTH ;
12511247 }
@@ -1274,7 +1270,8 @@ public function createCollection(string $id, array $attributes = [], array $inde
12741270 $ validator = new IndexValidator (
12751271 $ attributes ,
12761272 $ this ->adapter ->getMaxIndexLength (),
1277- $ this ->adapter ->getInternalIndexesKeys ()
1273+ $ this ->adapter ->getInternalIndexesKeys (),
1274+ $ this ->adapter ->getSupportForIndexArray ()
12781275 );
12791276 foreach ($ indexes as $ index ) {
12801277 if (!$ validator ->isValid ($ index )) {
@@ -2199,7 +2196,8 @@ public function updateAttribute(string $collection, string $id, ?string $type =
21992196 $ validator = new IndexValidator (
22002197 $ attributes ,
22012198 $ this ->adapter ->getMaxIndexLength (),
2202- $ this ->adapter ->getInternalIndexesKeys ()
2199+ $ this ->adapter ->getInternalIndexesKeys (),
2200+ $ this ->adapter ->getSupportForIndexArray ()
22032201 );
22042202
22052203 foreach ($ indexes as $ index ) {
@@ -3079,10 +3077,6 @@ public function createIndex(string $collection, string $id, string $type, array
30793077
30803078 $ isArray = $ collectionAttribute ->getAttribute ('array ' , false );
30813079 if ($ isArray ) {
3082- if (!$ this ->adapter ->getSupportForIndexArray ()) {
3083- throw new IndexException ('Indexing an array attribute is not supported ' );
3084- }
3085-
30863080 if ($ this ->adapter ->getMaxIndexLength () > 0 ) {
30873081 $ lengths [$ i ] = self ::ARRAY_INDEX_LENGTH ;
30883082 }
@@ -3108,7 +3102,8 @@ public function createIndex(string $collection, string $id, string $type, array
31083102 $ validator = new IndexValidator (
31093103 $ collection ->getAttribute ('attributes ' , []),
31103104 $ this ->adapter ->getMaxIndexLength (),
3111- $ this ->adapter ->getInternalIndexesKeys ()
3105+ $ this ->adapter ->getInternalIndexesKeys (),
3106+ $ this ->adapter ->getSupportForIndexArray ()
31123107 );
31133108 if (!$ validator ->isValid ($ index )) {
31143109 throw new IndexException ($ validator ->getDescription ());
0 commit comments