Question: I am getting `SyntaxError: expected expression, got '}' @(shell):1:0` while hitting the query on shell

```
db.address.aggregate([ 
    {
        "$project": {
            "applications": {
                "$filter": {
                    "input": "$applications",
                    "as": "applications",
                    "cond": {

                        "$or": [
                            {
                                "$and": [
                                    {"$in": ['122018', "$$applications.code"]},
                                    {"$eq": ["$$applications.name", "DSB"]},
                                ]
                            },
                            {
                                "$and": [
                                    {"$in": ['122018', "$$applications.code"]},
                                    {"$eq": ["$$applications.name", "DSB"]},
                                ]
                            }
                        ]

                    }
                }
            },
            name: true
        }
    },
    {$unwind: {path: "$applications", preserveNullAndEmptyArrays: false}}
])

```

**where is the syntex error**

Answer: 
The problem is not in the Syntax but the way you are executing the query. In the shell, try removing all the blank lines and run in a single line, it will work. E.g.

```
db.address.aggregate([ { "$project": { "applications": { "$filter": { "input": "$applications", "as": "applications", "cond": {  "$or": [ { "$and": [ {"$in": ['122018', "$$applications.code"]}, {"$eq": ["$$applications.name", "DSB"]}, ] }, { "$and": [ {"$in": ['122018', "$$applications.code"]}, {"$eq": ["$$applications.name", "DSB"]}, ] } ]   } } }, name: true } }, {$unwind: {path: "$applications", preserveNullAndEmptyArrays: false}} ])

```

Or better yet, use a json file and run the json file as query.
The problem is a very common syntax error in mongo js. Double line break is not interpreted correctly by mongo. Remove the blank lines in l.24 and l.25 and try again.

```
db.address.aggregate([ 
{
    "$project": {
        "applications": {
            "$filter": {
                "input": "$applications",
                "as": "applications",
                "cond": {

                    "$or": [
                        {
                            "$and": [
                                {"$in": ['122018', "$$applications.code"]},
                                {"$eq": ["$$applications.name", "DSB"]},
                            ]
                        },
                        {
                            "$and": [
                                {"$in": ['122018', "$$applications.code"]},
                                {"$eq": ["$$applications.name", "DSB"]},
                            ]
                        }
                    ]
                }
            }
        },
        name: true
    }
},
{$unwind: {path: "$applications", preserveNullAndEmptyArrays: false}}])

```