Mongodb $lookup dynamic collection

As of now, you can’t. The from field cannot be an expression and must be a string literal. However, there is an open issue which you can track here that appears to be exactly what you need: https://jira.mongodb.org/browse/SERVER-22497.

Leave a Comment