How to pass ArrayList into repository class Java SDK

Hello all,

I am trying to retrieve a list of documents from CB through my repository class. The tricky thing here is im trying to pass in a List of Strings which contain id’s to be retrieved as the following:

@Query("#{#n1ql.selectEntity} WHERE meta().id IN $1 END")
List < myDocuments > findAllDocus(List < String > ids);

but im getting the following error: Unsupported type for JsonArray: class java.util.Arrays$ArrayListjava.lang.IllegalArgumentException: Unsupported type for JsonArray: class java.util.Arrays$ArrayList

My understanding is that I am passing a array list into the query and the “IN” keyword expects a JsonArray, now how do I make that work?

Hi Sebastian,

What version of Spring Data Couchbase are you using?

Can you share the full stack trace of the exception please?

Thanks,
David

In the latest version, either List<> or an array or JsonArray will work.
I do see an issue where queries generated from method names that use In or NotIn take only an array.