morphia icon indicating copy to clipboard operation
morphia copied to clipboard

$and doesn't work on NumberLong?

Open Dao007forever opened this issue 13 years ago • 1 comments

Hi,

We have a list of conversations, each with a timestamp represented as long. We can query the data inside a range by the query:

ds.createQuery(History.class).field("roomId").equal(roomId).field("ts") .greaterThanOrEq(fromTime).field("ts").lessThanOrEq(toTime).order("ts").asList();

With the original Morphia, it returns the correct list. With your fork, it returns an empty list. When we remove either of the condition, e.g. ds.createQuery(History.class).field("roomId").equal(roomId).field("ts").lessThanOrEq(toTime).order("ts").asList(); ds.createQuery(History.class).field("roomId").equal(roomId).field("ts").greaterThanOrEq(fromTime).order("ts").asList();

It returns a non-empty list. We really like the way your fork ensure the stricter validation of query, but this prevents us from using it.

Thank you!

Dao007forever avatar Dec 26 '12 02:12 Dao007forever

Can you put together a unit test demonstrating the issue?

jmkgreen avatar Apr 02 '13 20:04 jmkgreen