We're updating the issue view to help you get more done. 

MongoQueryFactory translates or-queries wrong

Description

I've found a bug in MongoQueryFactory. When I search an LRU space for "id=1 OR id=2" I can see in the debugger that it searches mongo using {_id:2} instead of {$or: {_id:1, _id:2}}. Here is a snippet from the attached test project:

// write objects
gigaSpace.write(new PersistedSpaceClass(1L));
gigaSpace.write(new PersistedSpaceClass(2L));

// query them
Assert.assertEquals(1, gigaSpace.readMultiple(new SQLQuery<>(PersistedSpaceClass.class, "id=1"), 5, ReadModifiers.MEMORY_ONLY_SEARCH).length);
Assert.assertEquals(1, gigaSpace.readMultiple(new SQLQuery<>(PersistedSpaceClass.class, "id=2"), 5, ReadModifiers.MEMORY_ONLY_SEARCH).length);
Assert.assertEquals(2, gigaSpace.readMultiple(new SQLQuery<>(PersistedSpaceClass.class, "id=1 OR id=2"), 5, ReadModifiers.MEMORY_ONLY_SEARCH).length);

// wait for objects to show up in mongo and evict them from the space
String collectionName = "xaptest.MongoDataSourceTest_d_s_PersistedSpaceClass";
for (; mongoTemplate.count(new Query(), collectionName) != 2; Thread.sleep(100));
gigaSpace.clear(null, ClearModifiers.EVICT_ONLY);

// query them again
Assert.assertEquals(2, gigaSpace.readMultiple(new SQLQuery<>(PersistedSpaceClass.class, "id=1 OR id=2")).length);

The test fails on the last assert: "expected:<2> but was:<1>".

The test is attached.

Workaround

None

Acceptance Test

None

Status

Assignee

Unassigned

Reporter

Yuval Dori

Labels

None

Priority

On Hold

SalesForce Case ID

None

Fix versions

None

Commitment Version/s

None

Due date

None

Product

None

Edition

None

Platform

All