当前位置: 动力学知识库 > 问答 > 编程问答 >

How can I insert "typical" field values on CouchDB?

问题描述:

When I have several documents where there is a field which value is selected from a small groups of choices, is there any tool that prevents from introducing a wrong value?

Thank you

Hugo

网友答案:

Depending on what exactly you're trying to accomplish, validation functions sound like what you need. All the validation functions (1 per design document, as many design documents per database as you need) are run before each write. If any validation function throws an error, the write is refused.

分享给朋友:
您可能感兴趣的文章:
随机阅读: