R
R
Radiss2020-02-24 23:17:28
symfony
Radiss, 2020-02-24 23:17:28

How to connect cloud.mongo.db to symfony's shopker engine?

Shopker is an engine for creating an online store. Used: PHP framework Symfony 4.x, Angular 7+, MongoDB 3+

On the hosting, the application was installed in the usual way + hosting mongo.db. But I need to connect cloud.mongo.db

What should I change in settings?

doctrine_mongodb.yaml

spoiler
spoiler

doctrine_mongodb:
    auto_generate_proxy_classes: '%kernel.debug%'
    auto_generate_hydrator_classes: '%kernel.debug%'
    connections:
        default:
            #server: 'mongodb://%mongodb_user%:%mongodb_password%@%mongodb_server%:%mongodb_port%'
            server: 'mongodb://%mongodb_server%:%mongodb_port%'
            #server: '%mongodb_uri%'
            
        
            options: {}
    default_database: '%mongodb_database%'
    document_managers:
        default:
            auto_mapping: true
            mappings:
                App:
                    is_bundle: false
                    type: annotation
                    dir: '%kernel.project_dir%/src/App/Document'
                    prefix: App\Document\
                    alias: App
                AppMainBundle:
                    is_bundle: true
                    type: annotation
                    dir: 'Document'
                    prefix: App\MainBundle\Document\
                    alias: AppMainBundle
                ImportExportBundle:
                    is_bundle: true
                    type: annotation
                    dir: 'Document'
                    prefix: Andchir\ImportExportBundle\Document\
                    alias: ImportExportBundle



In mongodb atlas, a cluster c db is created. Connection has a link
mongodb+srv://user:<password>@db1-qtnpj.azure.mongodb.net/test?retryWrites=true&w=majority


but if this link is in the config with the user and pass data, then mongo does not connect . It is

also not entirely clear how to make the site visible to all users, because there is a binding to ip, and I have it dynamic.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question