One question related with feature conditions, does...
# announcements
h
One question related with feature conditions, does it support to use nested json field or even array? Like we have the user attribute as
Copy code
{ address: {state: 'CA'}}
And we can add
address.state
in the JSON rule
f
yes, that's supported. Under Settings->Attributes, you can define attributes with dot notation. So if you add an attribute
address.state
as a string, it should show up in the dropdown when adding conditions.
h
Cool! so it support the lodash syntax right?
f
we modeled it after MongoDB query syntax
arrays are a little trickier to deal with than nested objects. If you want at least one array element to match a condition, you can use
$elemMatch
. For example, if you have an array of address objects instead of just a single address:
Copy code
{
  "addresses": {
    "$elemMatch": {
      "state": "CA"
    }
  }
}
h
interesting, I will check with MongoDB query syntax. Thanks~