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

Clear Embedded Documents From a Single Document

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Is there a way to clear out the data of all embedded documents.

      For example I have a contact with:

      Email Addresses
      Phone Numbers
      Addresses
      I have new data for all these fields and I want to replace them all. This is being done via a gem so it must me dynamic. I cant just call each embedded model and run destroy_all.

      What is the best way to delete all the data from embedded documents?

            Assignee:
            Unassigned Unassigned
            Reporter:
            jwaldrip Jason Waldrip
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: