我正在尝试使用 Cosmos DB SQL API 插入 Cosmos Graph DB。为此,我正在尝试使用azure-spring-data-cosmos
. 它确实适用于 CosmosRepository 实现,该实现具有一个具有良好定义的属性的类,如下所示。
代替像“名称”这样定义明确的属性,我想接受创建一组动态属性。有没有办法做到这一点?
@Container(containerName = "cars")
@CosmosIndexingPolicy(includePaths = {"/*"})
public class Car {
@Id
private String id;
@JsonProperty(value = "label")
private String label;
@PartitionKey
private String partitionKey;
private JsonNode[] name; // in place of this well defined property "name" I want to
// accept a map of arbitrary properties (names and their corresponding values) to
// create a schema-less Vertex.
}
为了完整起见,这是存储库
@Repository
public interface CarCosmosRepository extends CosmosRepository<Car, String> {
}