New issue
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
Add support for paging and sorting on GridFSTemplate [DATAMONGO-765] #1695
Comments
Oliver Drotbohm commented The reason for this is quite simple: currently we're using the Java driver's After a brief look I've noticed that |
Benjamin M commented Thanks for the quick response. And what about the Query no limiting/sorting? BTW: Is it possible to create a normal |
Benjamin M commented I've answered my question from above myself. So maybe you could just provide some
Now I can query everything I want to, including |
Oliver Moser commented what works for me is simply using a mongoTemplate instance instead:
which also gives me access to the inputStream of the stored file |
Oliver Moser commented \
you can autowire the mongoDbFactory instance in your service class and then wrap the instances returned by the
hope it helps |
Mark Paluch commented Since we switched to Document API we can benefit from |
Benjamin M opened DATAMONGO-765 and commented
I wondered why GridFsOperations' find methods won't return
Page<...>
. Or is there another way to get this done?Additionally I tried to to pass a Pageable object into my Query which doesn't work. Also the
limit(...)
method andwith(new Sort(...))
methods won't work.Here's my code:
List<GridFSFBFile> files = operations.find(new Query().limit(5));
List<GridFSDBFile> files = operations.find(new Query().with(pageable));
List<GridFSDBFile> files = operations.find(new Query().with(new Sort(Direction.DESC, "uploadDate")));
List<GridFSDBFile> files = operations.find(new Query().with(new Sort(new Sort.Order(Direction.ASC, "uploadDate"))));
All of those queries return the same objects in the same order
Affects: 1.3.1
Issue Links:
("is duplicated by")
("supersedes")
Referenced from: pull request #806
3 votes, 8 watchers
The text was updated successfully, but these errors were encountered: