0
かなり簡単(私が望む)。私は、APIのエンドポイントを使用して、指定されたフィールドだけを返すことができるようにしたいと思います。 I.このStrapiで選択した特定のフィールドのみを返すにはどうすればよいですか?
http://localhost:1337/api/reference?select=["name"]
のようなものが理想的な形の何か
[{"name": "Ref1"}]
を返します残念ながらそうではなく、実際にそれが次の値を返します。
[
{
"contributors": [
{
"username": "aduensing",
"email": "[email protected]",
"lang": "en_US",
"template": "default",
"id_ref": "1",
"provider": "local",
"id": 1,
"createdAt": "2016-07-28T19:39:09.349Z",
"updatedAt": "2016-07-28T19:39:09.360Z"
}
],
"createdBy": {
"username": "aduensing",
"email": "[email protected]",
"lang": "en_US",
"template": "default",
"id_ref": "1",
"provider": "local",
"id": 1,
"createdAt": "2016-07-28T19:39:09.349Z",
"updatedAt": "2016-07-28T19:39:09.360Z"
},
"updatedBy": {
"username": "aduensing",
"email": "[email protected]",
"lang": "en_US",
"template": "default",
"id_ref": "1",
"provider": "local",
"id": 1,
"createdAt": "2016-07-28T19:39:09.349Z",
"updatedAt": "2016-07-28T19:39:09.360Z"
},
"question": {
"createdBy": 1,
"createdAt": "2016-07-28T19:41:33.152Z",
"template": "default",
"lang": "en_US",
"name": "My Question",
"content": "Cool stuff, huh?",
"updatedBy": 1,
"updatedAt": "2016-07-28T19:45:02.893Z",
"id": "579a5ff83af4445c179bd8a9"
},
"createdAt": "2016-07-28T19:44:31.516Z",
"template": "default",
"lang": "en_US",
"name": "Ref1",
"link": "Google",
"priority": 1,
"updatedAt": "2016-07-28T19:45:02.952Z",
"id": "579a60ab5c8592c01f946cb5"
}
]
これはすぐに、私は一度に10、20、30、または複数のレコードをロードすることを決定した場合、私は、任意の現実世界の文脈で問題となると、私は必要な50倍のデータをロードしてしまいます。より多くの帯域幅が使用され、ロード時間が遅くなります。