からの結果を返さない:ループバック3.0:フィルターは、私はこのような、単一の単純なモデルで、ループバックAPI持ちのREST API
{
"name": "Establishment",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"Distance": {
"type": "number"
},
"EstablishmentId": {
"type": "number"
},
"EstablishmentType": {
"type": "string"
},
"Location": {
"type": "string"
},
"MinCost": {
"type": "number"
},
"Name": {
"type": "string"
},
"Stars": {
"type": "number"
},
"UserRating": {
"type": "number"
},
"UserRatingTitle": {
"type": "string"
},
"UserRatingCount": {
"type": "number"
},
"ImageUrl": {
"type": "string"
},
"ThumbnailUrl": {
"type": "string"
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
予想通りの結果のhttp://localhost:3000/api/Establishments
リターンすべて、シンプルに電話を。 http://localhost:3000/api/Establishments?filter[where][distance][gt]=30
を呼び出すと結果はまったく得られません。空の配列です。
Establishment
がたくさんあり、Distance
が30を超えています。他のプロパティで実際にフィルタを使用すると、空の配列になります。私は何が欠けていますか?
多分距離」の大文字と小文字が区別試みは、最初の文字を小文字またはちょうど使用するようにモデルにあなたのフィールドの名前を変更するので、 "あなたのフィルタで –