How can I generate an autoincremented Id in a Cosmos DB if I do a POST request from Spring Boot.
How can I generate an autoincremented Id in a Cosmos DB if I do a POST request from Spring Boot.
The docs explain the behavior here: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-spring-data-cosmos#spring-data-annotations
public class GeneratedIdEntity {
@Id
@GeneratedValue
private String id;
}
As mentioned, Cosmos uses UUIDs rather than an auto-increment long.