MongoDB中的导入数据库模式
我为MongoDB创建了JSON模式。看起来像:
{
"schemaType": "Collection",
"name": "Manufacturier",
"defaultValue": "",
"description": "...",
"fields": [
{
"schemaType": "Field",
"name": "_id",
"type": "ObjectId",
"required": true,
"unique": true,
"defaultValue": "",
"description": "...",
"index": 0,
"customProps": []
}
]
}
...
我可以将此架构导入MongoDB吗?以及如何(如果可能的话)
I created json schema for MongoDB. It's look like:
{
"schemaType": "Collection",
"name": "Manufacturier",
"defaultValue": "",
"description": "...",
"fields": [
{
"schemaType": "Field",
"name": "_id",
"type": "ObjectId",
"required": true,
"unique": true,
"defaultValue": "",
"description": "...",
"index": 0,
"customProps": []
}
]
}
...
Can I import this schema into mongodb? And how (if it's possible)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您可以插入文档的最大优势之一,而无需提前定义模式,后来可以选择添加@alex blex ,但这限制了您要使用nosql mongodb数据库而不是其他可能的数据存储系统的主要原因。 ..
This is one of the biggest advantage of mongoDB that you can insert documents without the need to define the schema in advance , afcourse there is option to add schema validation rules as commented by @Alex Blex , but this is limiting the main reason you would like to use noSQL mongoDB database instead of other possible data storage system ...