php - Doctrine MongoDB ODM embed document appending elements adding blank array

740
return $this->persistantManager->createQueryBuilder( get_class( $user ) )
        ->field( 'field' )
        ->equals( 'data' )
        ->findAndUpdate()
        ->returnNew()
        ->field( 'info' )
        ->pushAll( $user->geInfo() )

$user->geInfo() returnsarray of info object. after executing it it adds a blank array everytime uner info field .$user->geInfo() returns populated data which it supposed to be inserted but it is not happening

User object field annotation

/** @ODM\EmbedMany(targetDocument="Info") */
    private $info = [];

Info Object annotation

 /** @ODM\ID */
        private $info;

        /** @ODM\Field(type="string") @ODM\Index */
        private $details;

People are also looking for solutions to the problem: php call function when connected to file

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.