Merge branch 'master' of gh:simolus3/moor

This commit is contained in:
Simon Binder 2020-05-18 21:13:49 +02:00
commit a2117c593c
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 6 additions and 2 deletions

View File

@ -35,11 +35,15 @@ Future<List<Animal>> findAnimalsByLegs(int legCount) {
```
## Boolean algebra
You can nest boolean expressions by using the `&`, `!` operators and the `not` method
You can nest boolean expressions by using the `&`, `|` operators and the `not` method
exposed by moor:
```dart
// find all animals that aren't mammals and have 4 legs
select(animals)..where((a) => a.isMammal.not() & a.amountOfLegs.equals(4))
select(animals)..where((a) => a.isMammal.not() & a.amountOfLegs.equals(4));
// find all animals that are mammals or have 2 legs
select(animals)..where((a) => a.isMammal | a.amountOfLegs.equals(2));
```
## Arithmetic