pql
pql copied to clipboard
A python expression to MongoDB query translator
The Python ast module, which this library depends on has been changed in more recent versions of Python. For sure 3.8, and possibly 3.7 or earlier. The ast parser assigns...
The Python ast module, which this library depends on has been changed in more recent versions of Python. For sure 3.8, and possibly 3.7 or earlier. The ast parser assigns...
I just wrote quick fix of #29 by producing `handle_Constant()` method for each AstHandlers. And the existing `handle_Num()`, `handle_Str()`, .. methods were left untouched to obtain backward compatibility. See https://docs.python.org/3/library/ast.html#ast.NodeVisitor.generic_visit...
Input such as `pql.find("a < -1")` does not work, is there anyway to fix that?
Is it possible to use pql to generate multiple conditions on the same term? For example: ``` {'$and': [{'a': {'$gt': 1, '$lt': 10}]} ``` As opposed to a series of...
When I ran your first very simple example I got an error ``` pql.find("a > 1 and b == 'foo' or not c.d == False") ParseError: Unsupported syntax (NameConstant). options:...
Because pql simulate the python language so it may be very helpful if it support the same way with python as below query = '{var1} and {var2}'.format(var1=var1 or True, var2=var2)...
Hello, I am writing a restful sevice which act a storage layer to mongodb/mysql/... . mongodb query format is quite good for restful , but the problem is how to...
{$and: [{a: {$gt: 1}}, {a: {$lt: 2}}]} -> {a: {$gt: 1, $lt: 2}}