0
votes

When I call my loopback API on the route /models/?filter={"include":"c"}, I get the following result :

[
{
"a": 1,
    "b": "abc",
    "c": [
      //
    ]
},
{
    "a": 2,
    "b": "def",
    "c": [
      //
    ]
},
{
    "a": 3,
    "b": "xyz",
    "c": [
      //
    ]
}
]

How can I get only the results where the "c" array is empty ? Basically I would like to reproduce a WHERE COUNT(c) = 0 clause.

1

1 Answers

1
votes

You can use LoopBack Where Filter: Link

Example :

/models/?filter={"where":{c: {$size: {$lt:0}}}