Loopback: Error: Items must be an array: {}\n at new List

Created on 5 Jul 2017  路  5Comments  路  Source: strongloop/loopback

Hi,

I created a products model and tring to get data through api. I got records in some where query.
success - lp-explorer-products-get-c_id 1

In sometimes i got error refer my error screen shot
error - lp-explorer-products-get-c_id 2

Check my Mongo DB Data
mongodb-screenshot

My error

{
"error": {
"statusCode": 400,
"name": "Error",
"message": "Items must be an array: {}",
"stack": "Error: Items must be an array: {}\n at new List (D:\api\node_modules\loopback-datasource-juggler\lib\list.js:35:17)\n at List (D:\api\node_modules\loopback-datasource-juggler\lib\list.js:17:12)\n at ModelConstructor.ModelBaseClass._initProperties (D:\api\node_modules\loopback-datasource-juggler\lib\model.js:355:28)\n at ModelConstructor.ModelBaseClass (D:\api\node_modules\loopback-datasource-juggler\lib\model.js:60:8)\n at ModelConstructor (D:\api\node_modules\loopback-datasource-juggler\lib\model-builder.js:196:22)\n at ModelConstructor (D:\api\node_modules\loopback-datasource-juggler\lib\model-builder.js:196:22)\n at new ModelConstructor (D:\api\node_modules\loopback-datasource-juggler\lib\model-builder.js:196:22)\n at buildResult (D:\api\node_modules\loopback-datasource-juggler\lib\dao.js:2023:19)\n at D:\api\node_modules\loopback-datasource-juggler\lib\dao.js:2073:13\n at doNotify (D:\api\node_modules\loopback-datasource-juggler\lib\observer.js:155:49)\n at doNotify (D:\api\node_modules\loopback-datasource-juggler\lib\observer.js:155:49)\n at doNotify (D:\api\node_modules\loopback-datasource-juggler\lib\observer.js:155:49)\n at doNotify (D:\api\node_modules\loopback-datasource-juggler\lib\observer.js:155:49)\n at Function.ObserverMixin._notifyBaseObservers (D:\api\node_modules\loopback-datasource-juggler\lib\observer.js:178:5)\n at Function.ObserverMixin.notifyObserversOf (D:\api\node_modules\loopback-datasource-juggler\lib\observer.js:153:8)\n at Function.ObserverMixin._notifyBaseObservers (D:\api\node_modules\loopback-datasource-juggler\lib\observer.js:176:15)"
}
}
What am I doing wrong? Please give me solution.

stale

Most helpful comment

@sarankani how did you fix it?

All 5 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

i fixed it.

@sarankani how did you fix it?

How to fixed it ?

i fixed it.

@sarankani Can we have a possible solution here, please?

Was this page helpful?
0 / 5 - 0 ratings