Skip to content

$not

Returns the logical negation of the supplied expression.

Syntax

{ "$not": [ <expression> ] }

Example

Input

{ "isDeleted": false }

Stage

{ "$project": { "isActive": { "$not": ["$isDeleted"] } } }

Output

{ "isActive": true }