MongoDB中的导入数据库模式

发布于 2025-02-04 02:29:58 字数 525 浏览 6 评论 0原文

我为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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

感性不性感 2025-02-11 02:29:58

这是您可以插入文档的最大优势之一,而无需提前定义模式,后来可以选择添加@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 ...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文