I have 6 different aggregate functions. I expanded the first one just for better visual. I am getting the same error as the original poster.
Should I be changing group's _id parts "cmts" : 1 to be "cmts" : "$cmts" ??
db.modems.aggregate(
{$match: {"bootfile": /ims/, "cmts": "<someserver>"}},
{$project: {
"_id": 0,
"is_ims": {$cond: [{"e": {$substr: ['$bootfile', 0, 1]}}, 0, 1]},
"cmts": 1}},
{$group: {
"_id": {"cmts": 1, "is_ims": 1},
"count": {$sum: 1}}});
db.modems.aggregate({$match: {"bootfile": /ims/, "cmts": "<someserver>"}}, {$project: {"_id": 0, "is_ims": {$cond: [{{$substr: ['$bootfile', 0, 1]}: {$ne: 'd'}}, 0, 1]}, "cmts": 1}}, {$group: {"_id": {"cmts": 1, "is_ims": 1}, "count": {$sum: 1}}});
db.modems.aggregate({$match: {"bootfile": /ims/, "cmts": "<someserver>"}}, {$project: {"_id": 0, "is_ims": {$cond: [{$cmp: [{$substr: ['$bootfile', 0, 1]}, 'e']}, 0, 1]}, "cmts": 1}}, {$group: {"_id": {"cmts": 1, "is_ims": 1}, "count": {$sum: 1}}});
db.modems.aggregate({$match: {"bootfile": /ims/, "cmts": "<someserver>"}}, {$project: {"_id": 0, "is_ims": {$cond: [{0: {$gt: {$cmp: [{$substr: ['$bootfile', 0, 1]}, 'e']}}, 0, 1]}, "cmts": 1}}, {$group: {"_id": {"cmts": 1, "is_ims": 1}, "count": {$sum: 1}}}); }
db.modems.aggregate({$match: {"bootfile": /ims/, "cmts": "<someserver>"}}, {$project: {"_id": 0, "is_ims": {$cond: [{0: {$gt: {$cmp: [{$substr: ['$bootfile', 0, 1]}, 'e']}}}, 0, 1]}, "cmts": 1}}, {$group: {"_id": {"cmts": 1, "is_ims": 1}, "count": {$sum: 1}}}); }
db.modems.aggregate({$match: {"bootfile": /ims/, "cmts": "<someserver>"}}, {$project: {"_id": 0, "is_ims": {$cond: [{4: {$gt: {$cmp: [{$substr: ['$bootfile', 0, 1]}, 'e']}}}, 0, 1]}, "cmts": 1}}, {$group: {"_id": {"cmts": 1, "is_ims": 1}, "count": {$sum: 1}}}); }