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!

posta 10 mesi fa812 visualizzazioni
1 Risposta
1
Risposta accettata

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
con risposta 10 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande