Syntax error with "$lt" and "$gt"

  File "dot_find_test.py", line 154
    data = my_collection.find({ ID : { $lt: BPACO-00001 } })
                                       ^
SyntaxError: invalid syntax

I can’t find anyone else that has this problem, do I need to import something? The error is specifically pointing to the ‘$’

You have to put literals within quotes.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.