简体   繁体   English

AWS DocumentDB 中模式验证的替代方案

[英]Alternative to schema validation in AWS DocumentDB

I am moving my database in MongoDB to AWS DocumentDB.我正在将 MongoDB 中的数据库移动到 AWS DocumentDB。 I am using mongodb-driver (version 3.6.4) in Java to write and read the data, as well as to configure the collections I use.我在Java中使用mongodb-driver (版本3.6.4)写入和读取数据,以及配置我使用的collections。 In particular, I have a schema validation (written as a JSON Schema) which seems not to be compatible with AWS DocumentDB.特别是,我有一个模式验证(写为 JSON 模式),它似乎与 AWS DocumentDB 不兼容。

Here the documentation says that $jsonSchema is not supported, but I have not seen any explicit assertion about document validation in general. Here the documentation says that $jsonSchema is not supported,但我还没有看到任何关于一般文档验证的明确断言。

Is it really unsopported?真的不支持吗? Is there any alternative (besides doing it in the Java code)?有没有其他选择(除了在 Java 代码中执行)?

As pointed out by smthakur19 in a comment above and as I expected, DocumentDB does not have the notion of required properties.正如 smthakur19 在上面的评论中所指出的以及我所预料的那样,DocumentDB 没有必需属性的概念。 However, it does have pre-triggers (eg one that runs a stored procedure prior to performing an insert).但是,它确实有预触发器(例如,在执行插入之前运行存储过程的触发器)。 So it is possible to validate fields within a stored procedure and reject inserts that do not contain required properties in a given document type.因此,可以验证存储过程中的字段并拒绝在给定文档类型中不包含所需属性的插入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS documentdb 不支持 $expr' 运算符 - $exp 的任何替代方法 - $expr' operator not supported in AWS documentdb - Any alternative to $exp Orion 是否与 AWS DocumentDB 兼容 - Is Orion compatible with AWS DocumentDB ToroDB 是否可用于 aws DocumentDB - Is ToroDB available for aws DocumentDB 如何将锁孔连接到 AWS DocumentDB? - How to connect keyhole to AWS DocumentDB? 尝试将环回 mongodb 连接器与 AWS DocumentDB 连接 - Trying to connect the loopback mongodb connector with AWS DocumentDB 如何将 AWS Elastic Bean Stalk 连接到 DocumentDB - How to connect AWS Elastic Bean Stalk to DocumentDB 与 Mongodb 相比,AWS DocumentDb 查询运行缓慢 - AWS DocumentDb queries running slow compared to Mongodb 连接到 AWS DocumentDB 时出现连接错误 - connection error while connecting to AWS DocumentDB 使用 AWS DMS 将 DocumentDB 表迁移到另一个 DocumentDB 表时如何在目标表中自动生成新的 _id - How to autogenerate new _id in target table when migrating a DocumentDB table using AWS DMS to another DocumentDB table 遇到 AWS Elastic BeanStalk 事件错误:清单文件有架构验证错误 - Running into AWS Elastic BeanStalk Event Error: Manifest file has schema validation errors
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM