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

GPMONGODB-242: Query a List using a result list does not work #313

Closed
graemerocher opened this issue Dec 10, 2012 · 0 comments
Closed

GPMONGODB-242: Query a List using a result list does not work #313

graemerocher opened this issue Dec 10, 2012 · 0 comments

Comments

@graemerocher
Copy link
Member

Original Reporter: confile
Environment: MAC OSX 10.8.2
Version: 1.0.0.GA
Migrated From: http:https://jira.grails.org/browse/GPMONGODB-242

I have a User and a Book domain class. Where user has many books and the Book class belongsTo user. I query the following:

            def userBooks = Book.withCriteria {
                    eq("category", "fiction")
            }

Having the result I want to use it in the next query to find all the users who wrote fiction books:

            def users = User.withCriteria {
                    'in'(books, userBooks)
            }

This does not work. So how can I use the first query result in the second query?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant