Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用GraphiQL的MongoDB领域:嵌套对象属性上的空值(仅链接时)_Mongodb_Graphql - Fatal编程技术网

使用GraphiQL的MongoDB领域:嵌套对象属性上的空值(仅链接时)

使用GraphiQL的MongoDB领域:嵌套对象属性上的空值(仅链接时),mongodb,graphql,Mongodb,Graphql,我正在使用MongoDB领域接口中的GraphiQL 我的模型“Training”和“Buildind”中有2个实体 当我请求列出所有建筑物时,一切正常。 当我申请带有链接建筑的培训列表时,我没有度假的价值开始日期和结束日期 这是一个错误还是我在规则上遗漏了什么 培训模式: "title": "training", "properties": { "_id": { "bsonType&

我正在使用MongoDB领域接口中的GraphiQL

我的模型“Training”和“Buildind”中有2个实体

当我请求列出所有建筑物时,一切正常。

当我申请带有链接建筑的培训列表时,我没有度假的价值开始日期和结束日期

这是一个错误还是我在规则上遗漏了什么

培训模式:

"title": "training", "properties": { "_id": { "bsonType": "objectId" }, "building": { "bsonType": "objectId" } (...) } } 建筑模式

{
  "title": "building",
  "properties": {
    "_id": {
      "bsonType": "objectId"
    },
    "vacations": {
      "bsonType": "array",
      "items": {
        "bsonType": "object",
        "properties": {
          "start_date": {
            "bsonType": "date"
          },
          "end_date": {
            "bsonType": "date"
          }
        }
      }
    },
  (..)
  }
}

你得到答案了吗?你得到答案了吗?
{
  "title": "building",
  "properties": {
    "_id": {
      "bsonType": "objectId"
    },
    "vacations": {
      "bsonType": "array",
      "items": {
        "bsonType": "object",
        "properties": {
          "start_date": {
            "bsonType": "date"
          },
          "end_date": {
            "bsonType": "date"
          }
        }
      }
    },
  (..)
  }
}