Skip to content

Can't use ODM and ORM together #5020

Description

@Oskmoz

Hi,

I'm facing a problem on my application using both an SQL and a MongoDB database.
Using only the SQL databases with ORM and PHP attributes everything works fine.
However, as soon as I composer require doctrine/mongodb-odm-bundle (Tried with many versions), the POST resources break and I'm unable to POST anything. I tried with ODM annotations and attributes, this doesn't fix the issue.

Here is the doctrine_mongodb.yaml I am using :

Is there any solution to make attributes and resource work both with Documents and Entities ?

doctrine_mongodb:
    auto_generate_proxy_classes: true
    auto_generate_hydrator_classes: true
    connections:
        default:
            server: '%env(resolve:MONGODB_URL)%'
            options: {}
    default_database: '%env(resolve:MONGODB_DB)%'
    document_managers:
        default:
            # auto_mapping: true
            mappings:
                App:
                    is_bundle: false
                    type: attribute
                    dir: '%kernel.project_dir%/src/Document'
                    prefix: 'App\Document'
                    alias: App

bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions