Skip to content

Commit

Permalink
docs: add example for NOT operator to README (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkopczyn authored Oct 5, 2024
1 parent 9c9a708 commit 9abfc17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Query Language
>>> db.search((User.name == 'John') | (User.name == 'Bob'))
[{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}, {'name': 'Bob', 'age': 42}]
>>> # Negate a query with logical not
>>> db.search(~(User.name == 'John'))
[{'name': 'Megan', 'age': 27}, {'name': 'Bob', 'age': 42}]
>>> # Apply transformation to field with `map`
>>> db.search((User.age.map(lambda x: x + x) == 44))
>>> [{'name': 'John', 'age': 22}]
Expand Down

0 comments on commit 9abfc17

Please sign in to comment.