Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregate function lookup does work across collections #231

Open
Darkvater opened this issue Jun 14, 2024 · 0 comments
Open

aggregate function lookup does work across collections #231

Darkvater opened this issue Jun 14, 2024 · 0 comments

Comments

@Darkvater
Copy link

When doing a $lookup where the foreign field is a property on a collection flapdoodle does not return a result. Using latest 1.45.0 version

For example for a data structure like:

data class Data(val key: String, val nestedKeyCollection: List<NestedData>, val nestedKey: NestedData)
data class NestedData(val nestedKey: String)

the following lookup does not work and there are no results for nestedKeyCollection.nestedKey

db.getCollection("data").aggregate(
  lookup(
    from = "someCollection",
    localField = "someKey",
    foreignField = "nestedKeyCollection.nestedKey",
    newAs = "output",
  ),
)

If however the foreign field (nestedKey.nestedKey) is a simple property, or even nested property it does work

db.getCollection("data").aggregate(
  lookup(
    from = "someCollection",
    localField = "someKey",
    foreignField = "nestedKey.nestedKey",
    newAs = "output",
  ),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant