0 votes

When exporting a MongoDB ODM model without Framework support, the "db" property is not written to the exported file, and if present in the file (by manually setting it) removed.

Version: 3.2.7.1338

asked in Solved by (190 points)
recategorized by

2 Answers

0 votes

You can't export ODM model without Framework support. For Mongo ODB you need to have configured framework as Mongo ODM.

In case the problem is somewhere else, please post more details, some test project where this issue can be replicated

answered by Skipper developer (131k points)

I selected No MVC Framework. Which appears to work fine for exporting. The only issue I am running into is that the 'db' property is ignored.

If you create a new file, select MongoDB ODM and No MVC Framework, used default entity created by Skipper, set the 'db' property and export it to Doctrine Annotations, the 'db' property will be @ODM\Document not * @ODM\Document(db="mydb")

Check your email for code sample :)

Oh, ok. I wrongly understood "framework" as ORM framework. You're right that MVC doesn't make a difference in this case.

Thanks for the explanation. We will check it tomorrow and let you know.

0 votes
answered by Skipper developer (131k points)

Thanks it works. However there is a follow up issue with it when using inheritance via Mapped Superclass as it will also add the 'db' property to the parent and cause:

Unknown property 'db' on annotation 'Doctrine\ODM\MongoDB\Mapping\Annotations\MappedSuperclass

Thanks for report. Can you please send me testing project to [email protected] so we can test it and fix it right now? Thanks

Never mind, I apologize, the issue was mine having created a workaround until you fixed the original issue earlier.

No problem, I'm glad it's working now.