im trying to use the operator $and of MongoDB applied to the Phalcon\Mvc\Collection as follow:
$documents = Staff::find( $condition);
with array $condition having the "role" like this:
$condition["role"] = [
"\$regex" => "$somevalue",
"\$and"=> [
'$ne' => "admin"
]
];
and i get this error
Can't canonicalize query: Bad Value: unknown operator: $and'
Please help me solve this.
Is there any better way to apply multi conditions to this "role"?