> For the complete documentation index, see [llms.txt](https://gchandra.gitbook.io/big-data-and-tools-with-nosql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gchandra.gitbook.io/big-data-and-tools-with-nosql/nosql/mongodb/logical-operators.md).

# Logical Operators

$and -- **true** when all the  conditions are true, else false.&#x20;

$or -- **true** when at-least one condition is true, else false.&#x20;

$not -- negation true/false&#x20;

$nor -- **true** when all conditions are false, false otherwise.

```
/ age > 31 and location = NYC

db.friendsCollection.find(
    {
        $and:
            [
                {age : {$gt : 31}}
                ,{location: "NYC"}
            ]
    });

// Greater than or equal to 31 and name = Ross

db.friendsCollection.find(
    {
        $and:
            [
                {age : {$gte : 31}}
                ,{firstname: "Ross"}
            ]
    });
```
