1

I want to fetch actions list in user class by username with this query but its not working

@Repository
public interface IUserRepository extends CouchbaseRepository<User,Long> {

@Query("SELECT actions from #{#n1ql.bucket} where #{#n1ql.filter} and userName = $1 ")
List<Action> getActionsByUserName(String userName);

where am ı doing wrong?

hknyildz
  • 13
  • 2

1 Answers1

0

__id and __cas must be projected. They are included in n1ql.selectEntity

@Query("#{#n1ql.selectEntity} where #{#n1ql.filter} and userName = $1 ")

Or you can project them yourself :

@Query("SELECT actions, meta().id as __id, meta().cas as __cas from #{#n1ql.bucket} where#{#n1ql.selectEntity} where where #{#n1ql.filter} and userName = $1 ")

Michael Reiche
  • 375
  • 1
  • 7