When I try to to use new Aggregate framework from Python I got the next message:
OperationFailure: command SON([('aggregate', 'call_log'), ('pipeline', [{'$project': {u'date': '1', u'status': '1', u'number': '1', u'description': '1'}}])]) failed: exception: field path references must be prefixed with a '$' ("1"
The python’s code:
db.command('aggregate', 'test_collection', pipe_line=[{'$project':{u'date': '1', u'status': '1', u'number': '1', u'description': '1'}}])
What does this message means? Where’s the error?
Thanks!
Suppose, you should write not
'1', but1.'1'(with quotes) is interpreted as string, which causes error.