I’m solving the homework in Chapter 1.
I’m able to create the var pipeline, which has 23 documents, but when I run further commands like:
db.movies.aggregate(pipeline).itcount()
validateLab1(pipeline)
I get the following error:
assert: command failed: {
“operationTime” : Timestamp(1535089663, 1),
“ok” : 0,
“errmsg” : “A pipeline stage specification object must contain exactly one field.”,
“code” : 40323,
“codeName” : “Location40323”,
“$clusterTime” : {
“clusterTime” : Timestamp(1535089663, 1),
“signature” : {
“hash” : BinData(0,“7uz1RnBiJH/GFZp9WTUjnaroYbQ=”),
“keyId” : NumberLong(“6559514413705986049”)
}
}
} : aggregate failed
How do I solve for it?