Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3212

Collection entity

      Today we can't have an associated entity called Collection, because Model.collection returns the mongo collection from the current session.

      For example:

      class Book
        field :title
      
        embeds_one :collection
      end
      
      class Collection
        field :name
      
        embedded_in :book
      end
      

      So, if we try to get the book's collection with Book.collection, it won't work. There is any way to workaround on this? My suggestion would be change the collection method to a name that doesn't represents an abstraction so hight, I mean, change to collection_session or something like that, I really don't know a good name. Do I make myself clear?

      Thanks! :smiley:

            Assignee:
            arthurnn Arthur Nogueira Neves
            Reporter:
            andrielfn andrielfn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: