loopbackjs - loopback 2 - defining an array of objects on a model -


if have usermodel , define:

"events": {   "type": [     "object"   ] }, 

do need define else in usermodel.js able post things like: [{name: 'sample', ...}, ...] user table's events column?

i ask because if remove particular definition .json app compiles , database migrates, in, app compiles database states there issue users findbyid. debugging has narrowed down particular set of code.

i think can use structure

{  "events":{     "type": [        {           "key": "type",           "key2": "type"        }     ]  } } 

you can see .js example here , .json example here. can see issue implementation here says

this model has problem. when fetch data call, renders particular field ["object object"] though data saved in database.

which recommend try on own depend lot on versions , drivers.

though ask kind of database using?


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -