Creating MongoDB views in DocumentDB

0

Hello, During migration of MongoDB databases (v5.0.19) to DocumentDB (with engine 5.0.0), we've encountered an issue when creating a MongoDB View in DocumentDB.

We've created a DocumentDB database and have imported our existing MongoDB collections using mongorestore command. Then we tried to create Views using following query in mongosh console:

db.createCollection("aViewName",{viewOn:"sourceColectionName", pipeline:[...some pipeline...]})

but we got an error:

MongoServerError: Field 'viewOn' is currently not supported

There is another way to create a view with db.createView(), but according to DocumentDB, it's not supported. https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis.html

Is there a way to create MongoDB Views in DocumentDB?

Thank you in advance!

已提问 10 个月前815 查看次数
1 回答
1
已接受的回答

Hi there.

Please note creating views is not yet supported in Amazon DocumentDB. The 'viewOn' is a field used when calling the createView() command, which is therefore not supported by DocumentDB.

At present, there is an existing feature request for the support for views in Amazon DocumentDB. However, I do not have an ETA on when it would be rolled out. You can keep an eye on the below links where we announce updates and new feature releases.

[+] Databases blogs: https://aws.amazon.com/blogs/database/

[+] What's new with Documentdb: https://docs.aws.amazon.com/documentdb/latest/developerguide/release-notes.html

AWS
已回答 10 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则