Hi all,

it is the first time I notice this and I am not sure that this has been written 
down somewhere
and if it is known to others (and then what to do about it).

I had an Object with a ByteArray and then tried to find this object using the 
ByteArray and
it wasn’t found. It looks like the ByteArray will be converted to an “array”. 
When searching
the ByteArray would not match it, an Array matches it. When using anArray to 
find the object
and using a “getter” to get the value and comparing it will not lead to 
equality. I understand
that Mongo doesn’t have same types (Array, OrderedCollection, ByteArray) as 
Smalltalk but
I wonder if there can be done something to improve the situation?

Is this known? Can we improve it? I can of course workaround it by converting 
it to an
array/orderedcollection before comparing it.

holger


Example:

| data repository test res |
repository := VOMongoRepository database: 'dbtest'.
data := #[1 2 3 4].
test := ZEByteArrayVoyage new.
test byteArray: data.
repository save: test.

res := repository selectOne: ZEByteArrayVoyage where: [:each | each byteArray = 
data ].
res.    "---> UndefinedObject"
        
res := repository selectOne: ZEByteArrayVoyage where: [:each | each byteArray = 
data asArray].
res.    "---> ZEByteArrayVoyage"
        
res byteArray = data. “false.. OrderedCollection = ByteArray"
res byteArray = data asArray. “OrderedCollection = Array"
res byteArray = data asOrderedCollection. "true"

Reply via email to