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

Collection entity

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0.0 final
    • Component/s: None

      Description

      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:

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: