Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

$not where clause

how do i use the $not where comparison value?

http://devcenter.appery.io/documentat...

I have a database service and i want all the rows to be returned that don't have "Open" as the text in the 'NightName' Field.

I have tried
{"NightName": {"$not":"Open"}}

but this returned:
pre
{
"status":400,
"uri":"https://api.appery.io/rest/1/db/collections/Nights",
"response":{
"code":"DBSQ271",
"description":"Mongo error: error code is '17287'"
}
}/pre

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

$not where clause

Hello Joe.

Here is an example

{"Name":{"$not":{"$regex": "name"}}}
where
Name - collumn name
name - value I'm not looking for

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

$not where clause

Hi Egor,

This almost worked.
I dont want to return the row with the exact text "Open" in the 'NightName'.

I have a few rows with the 'NightName' "Open mic night".

your code removed this row.
its only rows with the exact text "Open" that I dont want it to return.

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

$not where clause

How would i write the code so that it doesnt return results with the exact text "Open", so that it will still let results with the text "Open mic night" pass through?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

$not where clause

Hi Joe,

Please try following:

pre

{"Name":{"$not":{"$regex": "Open$"}}}

/pre

Regards.

Return to “Issues”