I'm building a search suggestion text box control in JavaScript and am trying to find a way to compare the string the user typed against a JSON Object that represents the user's contact list.

The JSON Object looks like this:

```
var contacts = {
    'gmail' : [
        { name : 'Joe Smith', email : 'joe.smith@gmail.com' },
        { name : 'James Simpson', email : 'jim.simpson@gmail.com' }
    ]    
}

```

Using JSONPath, I've been able to successfully compare the string the user typed against a single field in the contact object (ie. I can test the name, or the email) using the following:

```
var input = "james";

var search_path = '$.*[?( /' + input + '/i.test(@.name))]';

var results = jsonPath(contacts ,search_path, {resultType:"VALUE"});

```

Which returns the `{James Simpson}` contact object, but if I had typed Jim instead of James it would return nothing unless I did two separate JSONPath queries - one against the name and the other against the email.

What I'm looking is an elegant way to do an OR operator with JSONPath so I can test a single string against multiple JSON property values.

Here's the psuedo-code **(non-working)** that describes what I'm looking for:

```
var search_path = '$.*[?( /' + input + '/i.test([ @.name, @.email ]))]';

```

Does anyone know of a way to do this?