Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple fields of compound index cannot be arrays

I am getting this error while migrating data from mongodb to documentdb. Indexes were created on documentdb side without problems.

2019-04-26T17:40:20.118+0000    error: multiple fields of compound index cannot be arrays
2019-04-26T17:40:20.445+0000    error: multiple fields of compound index cannot be arrays
2019-04-26T17:40:22.057+0000    error: multiple fields of compound index cannot be arrays

I see similar questions asked way back about mongodb, how is documentdb implementation differ from it? I did not see any issues while creating indexes in documentdb, only see it in restore during the restore

like image 991
oshaiken Avatar asked Dec 29 '25 18:12

oshaiken


1 Answers

Amazon DocumentDB does not yet support creating a compound index with multiple keys on the same array. A workaround is to create individual indexes on the desired array fields, as the Amazon DocumentDB query planner is capable of using multiple indexes in a single query.

https://docs.aws.amazon.com/documentdb/latest/developerguide/functional-differences.html

like image 190
Joseph Idziorek Avatar answered Jan 04 '26 21:01

Joseph Idziorek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!