Closed yvesgermain closed 1 year ago
The error message is :Get-MdbcData: Command find failed: cannot nest $ under $in.
I think this error is expected -- https://www.mongodb.com/docs/manual/reference/operator/query/in/#use-the--in-operator-with-a-regular-expression
You cannot use
$regex
operator expressions inside an$in
.
Try to recompose the expression using something like ~ $not
with $regex
and pattern Domain\\|AUTORITE NT\\
.
This worked: Get-MdbcData -Filter @{ '$nor' = @(@{ "IdentityReference" = @{'$regex' = '^Domain\\'}}, @{"IdentityReference" = @{'$regex' = '^AUTORITE NT\\'}})}
I'm trying to do a query where I don't want any IdentityReference that starts with either the string "Domain\" or "AUTORITE NT\". This is what I tried. How should this query be structured? Get-mdbcdata -Filter @{ "IdentityReference" = @{'$nin' = @( @{'$regex' = 'Domain\'}, @{'$regex' = 'AUTORITE NT\'} )} }