faerubin
faerubin

Reputation: 187

Spring Data MongoDB - no signature of method is applicable for argument types

I had a certain method that called MongoOperations.find(Query query, Class<T> entityClass, String collectionName), and returned a List<T> as expected. I want to change the method to stream(), in case the number of returned objects from the query is exceptionally large. According to the documentation, there should be an identical signature for stream(), but when I try to call the function with a collectionName, I get an error:

groovy.lang.MissingMethodException: No signature of method: org.springframework.data.mongodb.core.MongoTemplate.stream() is applicable for argument types: (org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)

When I remove the collectionName, it runs without error. Could this be an issue of Spring Data versions? How can I solve this?

Thanks.

Upvotes: 0

Views: 705

Answers (1)

s7vr
s7vr

Reputation: 75994

The overloaded stream method which takes collection name as an argument in MongoOperations is added in Mongo Spring 1.10 version.

The change is covered as part of the ticket. https://jira.spring.io/browse/DATAMONGO-1431

Upvotes: 1

Related Questions