S
S
Salavat Sitdikov2016-10-10 13:10:50
symfony
Salavat Sitdikov, 2016-10-10 13:10:50

How to connect to an existing mongo collection in Symfony?

There is an already existing database. It is necessary to implement the frontend on Symfony. There is an option using an additional class, but I wanted to organize it natively.
But how - I can not understand.
Can someone point my finger at the docstring or share their experience?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2016-10-10
@zona7o

https://symfony.com/doc/current/doctrine/multiple_...
Everything is easier than it seems...

$connection = $this->getDoctrine()->getManager('mongodb')->getConnection();

A
Andrey Shakhtarin, 2016-10-10
@AndreyShakhtarin

Why native? and why the class is additional?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question