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!

gefragt vor 10 Monaten812 Aufrufe
1 Antwort
1
Akzeptierte Antwort

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
beantwortet vor 10 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen