Given the following documents, I'm trying to find a log document given a token ID.
class Log
include Mongoid::Document
belongs_to :user
end
class User
include Mongoid::Document
embeds_many :tokens
end
class Token
include Mongoid::Document
end
I tried Log.where('user.tokens._id': BSON::ObjectId('123ABC')
with no luck. Any ideas?
Top comments (0)