Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-175

Removing file data from Document with file removes other fields aswell

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Document Manager
    • Labels:
      None
    • Environment:
      Symfony2, Doctrine ODM bundle

      Description

      Not sure if this project isn't abandoned as it looks but here goes.

      There is a problem with the gridfs files deletion.
      going by description in https://doctrine-mongodb-odm.readthedocs.org/en/latest/reference/storing-files-with-mongogridfs.html?highlight=file

      I created a document, the problem is, most of the times, the file is just temporary in mongodb (in my app anyway), and gets deleted after. The deletion (or $document->setFile(null) ) on the @MongoDB\File also removes all other fields in that document, besides the data itself. I have a bunch of statistical information in that document, and it all gets removed when I just remove the file. What's left is just the Id. This might be the way it was intended, however doesn't not really seam like the mapping is accurate here, as it obviously removes a lot more from the database, than I from the object.

      The operation should just remove the data that has been removed from the object.

        Activity

        Hide
        Jonathan H. Wage added a comment -

        This project has been a bit more active on github.com/doctrine/mongodb-odm

        Show
        Jonathan H. Wage added a comment - This project has been a bit more active on github.com/doctrine/mongodb-odm
        Hide
        Peter Jasiulewicz added a comment -

        Should I repost it then?

        Show
        Peter Jasiulewicz added a comment - Should I repost it then?
        Hide
        Jonathan H. Wage added a comment -

        Yes, I think it would help with other devs/users seeing it.

        Show
        Jonathan H. Wage added a comment - Yes, I think it would help with other devs/users seeing it.
        Hide
        Peter Jasiulewicz added a comment -

        OK, guess this can be closed then as a duplicate. Thanks.

        https://github.com/doctrine/mongodb-odm/issues/668

        Show
        Peter Jasiulewicz added a comment - OK, guess this can be closed then as a duplicate. Thanks. https://github.com/doctrine/mongodb-odm/issues/668

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Peter Jasiulewicz
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: