Not authorized on aggregations to execute command

HI,

When I try to execute db.createView(), get the authorization error

MongoDB Enterprise Cluster0-shard-0:PRIMARY> var pipeline = [ { “$sort”: {“name”: 1} }, { “$project”: {“name”:1, “phone”: { “$concat”: [ {"$arrayElemAt": [{"$split": ["$phone", " “]}, 0]} , “*" ] }, “ssn”: { “$concat”: [ "”, {”$arrayElemAt": [{"$split": ["$ssn", “-”]}, 2]} ] } } } ];
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db.createView(“people_contacts”, “people”, pipeline);
{
“operationTime” : Timestamp(1553784401, 1),
“ok” : 0,
“errmsg” : “not authorized on aggregations to execute command { create: “people_contacts”, pipeline: [ { $sort: { name: 1.0 } }, { $project: { name: 1.0, phone: { $concat: [ { $arrayElemAt: [ { $split: [ “$phone”, " " ] }, 0.0 ] }, “*" ] }, ssn: { $concat: [ "”, { $arrayElemAt: [ { $split: [ “$ssn”, “-” ] }, 2.0 ] } ] } } } ], viewOn: “people”, lsid: { id: UUID(“8c7965be-c8d3-40a8-9102-7cd9bf40f40c”) }, $clusterTime: { clusterTime: Timestamp(1553784391, 1), signature: { hash: BinData(0, 1794971E54174B9C2D34ED413872BA2936613453), keyId: 6627672121604571137 } }, $db: “aggregations” }”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1553784401, 1),
“signature” : {
“hash” : BinData(0,“loNPyLJxrP/QrtitPppo2nhYryw=”),
“keyId” : NumberLong(“6627672121604571137”)
}
}
}

Please check our forums
Another colleague had answered same issue 3 hrs back

Chapter 5 - not able to create views or find views