Datastore: Cannot get more than 1000 keys in a single call

Viewed 149

I am using spring boot and google datastore. Below is my main entity which is referencing other entity "patients".

@Entity(name = "depart_list")
public class DepartList {
  @Id private String compositeKey;
  @Reference private List<Patient> patients;
}


@Entity(name = "patient")
public class Patient {
  @Id private String compositeKey;
  private String cid;
  private LocalDate date;

Jpa method:

Page<DepartList> findByCompositeKey(String compositeKey, Pageable pageable);

Now the problem is I only have 1 result in datastore against depart_list BUT the referenced patient list values are more than 1000 and I don't know how to apply limit/page to that. which is why I am getting below exception.

com.google.datastore.v1.client.DatastoreException: cannot get more than 1000 keys in a single call, code=INVALID_ARGUMENT
1 Answers
Related