node.js - loopback set scope by name in JSON relation -


i'm defining relation between loopback models , want filter using scope. define custom scope in related model json definition this

"scopes":{     "blogid":{"where":{"originaltype":"blog"}} }, 

and want address in master model name, like

"oldid":{   "type": "hasone",   "model": "originalids",   "foreignkey": "iid",   "scope": "blogid" <------ },     

this not work, have explicitly set scope structure there like

"scope": {"where":{"originaltype":"blog"}} 

which leads code duplication. possible address scope name somehow?

i believe (and down vote me if i'm wrong), want here file er against loopback project add feature. me, makes perfect sense. issues may reported here: https://github.com/strongloop/loopback/issues


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -