Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nemanja Nedic opened DATAMONGO-602 and commented
There is a problem when trying to query for documents with id field is in a given list of BigInteger values. Id field is mapped as a BigInteger.
For example, these lines will work only if given id list contains only one item.
List<BigInteger> profileIds = findProfileIds(); Predicate predicate = QProfileDocument.profileDocument.id.in(profileIds); Iterable<ProfileDocument> profiles = profileRepository.findAll(predicate);
The underlying MongodbQuery is different if there is only one item in profileIds. The query looks like this for a profileIds with multiple elements
profileIds
{ "_id" : { "$in" : [ "25069473312490162649510603609" , "25045916045544535958655878835"]}}
and it looks like this when there is only one item in the list.
{ "_id" : { "$oid" : "5100fb776c67e7e092be6b59"}}
In the first case, query will return no results and in the second it will work and return an Iterable with one item.
As you can see, the problem is with the representation of the BigInteger. using decimal format will not work with MongoDB
Affects: 1.1.1
Referenced from: commits 9881ef9, 21352a8
Backported to: 1.2.4
The text was updated successfully, but these errors were encountered:
Thomas Darimont commented
Hello,
I tested this with the current version and it seems to work fine. Could you please upgrade your version to see whether this is still a problem?
I added some additional unit-tests to verify that this works as expected. Here is the gh PR: #59
Cheers, Thomas
Sorry, something went wrong.
could you please give this a spin with the latest version?
Thanks, Thomas
Nemanja Nedic commented
Sorry, the bug was filed long ago and I'm not on that project so I cannot check it now. I'll ask a colleague of mine to check it later
Oliver Drotbohm commented
We've added a test case ensure it's working in current versions
thomasdarimont
No branches or pull requests
spring-projects-issues commentedJan 30, 2013
Nemanja Nedic opened DATAMONGO-602 and commented
There is a problem when trying to query for documents with id field is in a given list of BigInteger values. Id field is mapped as a BigInteger.
For example, these lines will work only if given id list contains only one item.
The underlying MongodbQuery is different if there is only one item in
profileIds
. The query looks like this for aprofileIds
with multiple elementsand it looks like this when there is only one item in the list.
In the first case, query will return no results and in the second it will work and return an Iterable with one item.
As you can see, the problem is with the representation of the BigInteger. using decimal format will not work with MongoDB
Affects: 1.1.1
Referenced from: commits 9881ef9, 21352a8
Backported to: 1.2.4
The text was updated successfully, but these errors were encountered: