0 votes

Hi

I already use the ORM features and I started to use the new ODM features but I faced to some issues :

  • raw_type should be raw as specified in Raw annotation
  • Namespaces seems to not be handled for embedded documents. I tried to specify it on Document and Bundle options, but none works.
  • The bundle namespace is appended to collections name. However I would like to be able to specify the collection name without any \ like it's possible to specify a table name in ORM.
  • It's not possible to edit the label in link between collections and documents, so I get long labels I wish I could shorten like \Acme\DemoBundle\Document\MyDocument in acme_demo_my_document.

I'm still experimenting ODM features so maybe I do things in a wrong way...

in Solved by (180 points)
recategorized by

Hi, thanks for feedback from usage.

  • Raw_type will be fixed in the next release. In the meanwhile you can edit MongoDbOdm.skipper.cfg.xml at line 196 and update raw_type to raw
  • Namespaces for embedded document - can you please send us some a test file where this issue occured?
  • If you want to have a collection without namespace, simply set "\" namespace to collection. When namespace in any sub-object (region, entity, collection, ...) starts with \ it's used as absolute namespace for such element (http://i.hizliresim.com/BMnvPg.png)
  • Currently it's not possible to edit labels in links between collection and documents. I will add it to todo, maybe shortening of it only to local names would be sufficient.

In case you will find any other issues or have any ideas, let us know!

Thanks for your answer.

I uploaded a sample file with several bugs here :
- There is the issue with namespace generation for Client embedded Document.
- An empty DiscriminatorMap is added while there is no inheritance : @ODM\DiscriminatorMap({""="Acme\LogBundle\Document\Log"})

About the collection namespace, I noticed I can edit the namespace from the property editor.
However, if I leave the namespace property empty on the property editor, I can't edit it from the Collection editor. I get a readonly field with the default bundle namespace instead.

I hope the other fixes will be available soon! :)

Thanks, I downloaded the sample file and I'm going to check it.

1) We successfully found and fixed the issue with missing namespace. New beta with this and a few other fixes is being already built.

2) Empty discriminator map is caused by empty discriminator value in collection:
enter image description here

When entity is referenced by collection, this entity has to contain @DiscriminatorMap annotation and it's necessary to define discriminator value for such entity. It's mentioned here: http://i.hizliresim.com/JY9lWY.png

3) Can you please describe more in details (whit some screens) what exactly is wrong? Here is a short video how the application should behave: https://dl.dropboxusercontent.com/u/11355235/ShareX/2015-06/2015-06-17_15-25-46.mp4

Thank you for your time and your feedback!

I don't understand why I should define a discriminator? My concern is only about specifying the collection name for my document like this: @ODM\Document(collection="acme_log_log"). Maybe I'm not doing it the right way?
I should mention, I will have only one document for this collection. Maybe that the discriminator should be added when there is more than one document linked to the collection?

Ok, with your video I got the thing for namespace edition. From my viewpoint, the way to override the collection namespace is not very intuitive in the Collection editor. On the first attempt, I tried to delete the prefilled namespace instead of typing \.

No problem for feedback. I enjoy the ORM features since a long time and hope the ODM ones will become as good as this one. :)

1)
I'm not MongoDB ODM expert so maybe I overlooked something but why do you need a collection with single entity? Based on documentation I thought that collection is useful when two or more types of entities are stored in single storage.

2)
Oh, I understand. It was very difficult to find a way how to visualize namespaces derived from parents together with ability to override and also extend it from child. Do you have any idea how to make it more clear?

1) I'm not a MongoDB expert too, but from my knowledge you see collections like a table for sql databases. You have to specify its name somewhere, but by default Doctrine ODM use the document name as collection name. So it may be conflicting when you have the same name for document classes but want to store them on different collections.
For instance \Acme\DemoBundle\Document\Log into acme_demo_log and \Acme\Demo2Bundle\Document\Log into acme_demo2_log.
What I really miss is a simple text property like the table property on ORM, where I could put the collection name for this document.

2) I guess it was kinda difficult... Maybe that when typing delete on an empty hinted input it could react like when typing \. Something like in the following scenario :

[\Acme\DemoBundle\Document\]|
<delete>
\|
<delete>
[\Acme\DemoBundle\Document\]|

I hope it may give you some inspiration... :)

1)

Thanks for explanation. I have found following mention in MongoDB odm documentation: http://doctrine-mongodb-odm.readthedocs.org/en/latest/reference/basic-mapping.html#persistent-classes

So it's exactly like you wrote. We wrongly interpreted collections as multi-type containers only and not also the single-type container simillar to @table property.

We will have to figure out how to distinguish between single-type and multiple-type collection but I suppose we will add @collection property like you mentioned together with existing multi-type collection mechanism.

2)
I think this is a very good idea. I will discuss it here and if it will be possible we will implement it.

Thanks a lot.

Can't wait to try it! :)

Ok, 2) is integrated with skipper and 1) is implement too.

These two updates together with another ones are available in new beta:

http://support.skipper18.com/402/downloads-skipper-beta

I tested this new version and it works like a charm!

Thanks for your responsiveness. :)

Great! Thanks for testing.

1 Answer

0 votes

Implemented and fixed in latest beta:

http://support.skipper18.com/402/downloads-skipper-beta

by Skipper developer (141k points)