I think your getting a little mixed up. You can specify an object map like your second example. This is what the docs state about it when you do.
Object: A pattern object can be used to filter specific properties on
objects contained by array. For example {name:"M", phone:"1"}
predicate will return an array of items which have property name
containing "M" and property phone containing "1". A special property
name $ can be used (as in {$:"text"}) to accept a match against any
property of the object or its nested object properties. That's
equivalent to the simple substring match with a string as described
above. The predicate can be negated by prefixing the string with !.
For example {name: "!M"} predicate will return an array of items which
have property name not containing "M".
The important thing to take away here is the second sentence and the and. Meaning in order for a match the string, in your case text, has to match ALL properties specified in your map.
Searching for just male wont match if the name is only John for example. But searching for ma would return the following record:
{
name: 'mark',
gender: 'male'
}
Just for FYI you can also search by object map through the view but it has the same limitations.
That being said it is possible to use the $ wildcard giving it a comma separated list of properties. This will do an or match over any of the properties.
{
$: 'name,gender'
}
The catch here is all properties will have the same value checked against them.
Here's a fiddle showing them in action.
The other answers sum up quite well the alternatives, just felt they were lacking in explaining what was happening and the reasons behind it.