Missing index configuration firestore Spring Boot

68 views Asked by At

I'm trying to run a custom query for spring data firestore. In my FirestoreReactiveRepository I created:

findAllBySubTypeOrderByOccurredAt(String subType); 

and I created the indexes in firestore:

subType:ASC  occurredAt:ASC

But when I run the code I have the error:

FAILED_PRECONDITION: Missing index configuration. Please create corresponding index via gcloud.

1

There are 1 answers

0
Roland On

I found the problem. I still don't know how to see the query but the problem was that the model I used as the entity has the field occurredAt as sql.TimeStamp and I needed to use the com.google.Timestamp type. It worked to save into database but it was messed up to create the query with the indexes. Thank you for your help frank-van-puffelen