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ヶ月前812ビュー
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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ