楷模:
class User
include Mongoid::Document
embeds_many :user_topics
end
class UserTopic
include Mongoid::Document
embedded_in :user
embeds_many :user_topic_examples
end
和
class UserTopicExample
include Mongoid::Document
embedded_in :user_topic
end
如何获取属于特定用户的所有 user_topic_examples:
user.user_topic_examples
或者
user.user_topics.user_topic_examples
谢谢。