Error: not authorized on aggregation to execute command { aggregate:

What is that? Why I cant make db.movies.aggregate() ? Whole error looks like:
“not authorized on aggregation to execute command { aggregate: “movies”, pipeline: [ { $match: { title: { $type: “string” } } }, { $project: { titleArr: { $split: [ “$title”, " " ] } } }, { $match: { titleArr: { $size: 1.0 } } } ], cursor: {}, lsid: { id: UUID(“f354d9d1-9d07-4b5e-92c4-fea9560b124b”) }, $clusterTime: { clusterTime: Timestamp(1542479229, 1), signature: { hash: BinData(0, AD09FCA94A3EB28AFDE18FBDDCD327A79111D60D), keyId: 6595588990781358081 } }, $db: “aggregation” }”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1542479319, 1),
“signature” : {
“hash” : BinData(0,“TIT6VpfwduzjqOeKCTv85LuOAN4=”),
“keyId” : NumberLong(“6595588990781358081”)
}
}
}

Ah I have it. It is aggregations not aggregation. Why Mongo does not throw an error when I use non existing database?

Because MongoDB implicitly creates any database that you call to, without warning you. For example, you can use fakeDB; db.fake.insertOne("a":"1"); without issues.

And it is a design choise they made. One that I really like. One of the reason I like it is that there is no migration script to write when your code needs a new DB or collection or field.