I’m trying to split my amount field(String) and remove dollar symbol, for grouping and sum of amount, but I’m getting error saying $ is not valid path, I’m new to MongoDB aggregations and not able to figure out how to split it.
pymongo.errors.OperationFailure: Invalid $project :: caused by :: '$' by itself is not a valid FieldPath, full error: {'ok': 0.0, 'errmsg': "Invalid $project :: caused by :: '$' by itself is not a valid FieldPath", 'code': 16872, 'codeName': 'Location16872'}
pymongo.errors.OperationFailure: $convert found an unknown argument: cost_split, full error: {'ok': 0.0, 'errmsg': '$convert found an unknown argument: cost_split', 'code': 9, 'codeName': 'FailedToParse'}