Hi Norbert,
Aha! I unterstand.��
This is an interesting aspect. Fortunately I dont have��this case at the moment. I will keep this in mind for the future.
Regards

Am Mittwoch, 9. M��rz 2016 schrieb NorbertHartl [via Smalltalk] :
Sabine,

maybe my description wasn't clear enough. If you start to use voyage like that you have the constraint that all objects returned from the collection need to be the same or a subclass of the one you are using to search. Meaning

If you query

One selectAll

then all of the objects in the Numbers collection need to be the same class or a subclass of One. So this use case is at first only feasible if you want to find all instances of Numbers. Your basic query needs to be

Numbers selectAll

If you then want to deal only with instances of One you would need to add this to the query

Numbers selectMany: {
'#instanceOf' -> #One } asDictionary

This is not a nice approach but for this use case it should give you the desire result.

Norbert

Am 09.03.2016 um 10:52 schrieb Sabine Manaa <[hidden email]>:

Norbert, thank you. Ok, the Numbers collection name is clear.

If I use

<mongoContainer>
^ VOMongoContainer new
collectionName: 'Numbers';
yourself

the data is stored correctly in the Numbers collection in Mongo. Also the relationship is fine.
Everything fine till here.

But after��

VOMongoRepository current reset.

I have problems with fetching the data from mongo

If I define

mongoContainer
<mongoContainer>
^ VOMongoContainer new
enableMissingContent;
collectionName: 'Numbers';
"kind: self;"
yourself

Then I get the error "Bad object requested (Three does not inherits from One)"

If I define��

mongoContainer
<mongoContainer>
^ VOMongoContainer new
enableMissingContent;
collectionName: 'Numbers';
kind: self;
yourself

Then I get an Inspector with 3 instances of "One" (I refer to the workspace of the image from tommasso)
It should be only one instance of One
Clicking on the one instances, I get an emergency screen with
��***System error handling failed****
VOMongoError: Lazy reference not found ...
��
Tommasso, do you get the same results?

I am curious about the solution.


***************This is the workspace of tommasso
repository dropDatabase.
repository := VOMongoRepository
host: 'localhost'
database: 'VoyageMongo-Link-Test-5'.
repository enableSingleton.

one := One new.
two := Two new.
three := Three new.

one link: two.
one link: three.

one save.
two save.
three save.

VOMongoRepository current reset.

One �� selectAll ��


View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726p4883475.html
To start a new topic under Pharo Smalltalk Users, email <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;ml-node%2Bs1294792n1310670h65@n4.nabble.com&#39;);" target="_blank">ml-node+s1294792n1310670h65@...
To unsubscribe from Pharo Smalltalk Users, click here.
NAML


View this message in context: Re: [Pharo-users] Voyage, Magritte descriptions, and nil exceptions
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.