On Sep 15, 6:00 pm, Durran Jordan <
dur...@gmail.com> wrote:
> That query cannot be done in MongoDB. The example article you linked to is
> trying to find users based on values in the access_grants table via a join.
> If you modeled this the same way you would have a users collection and an
> access_grants collection in MongoDB and it could not be accomplished in a
> single query, you would have to do it in 2.
>
> user_id = AccessGrant.where(:access_token =>
> conditions[:token_authentication_key]).any_of({ :access_token_expires_at =>
> nil }, { :
access_token_expires_at.gt => Time.now).first.user_id
> user = User.find(user_id)
>