Fix whete typo (#59)
This commit is contained in:
parent
d42e1b3f5c
commit
546b7ae53c
|
|
@ -14,7 +14,7 @@ Now, _result_ contains **QList\<QSharedPointer\<Post\>\>** and can be used in co
|
||||||
## Getting first record in query
|
## Getting first record in query
|
||||||
```cpp
|
```cpp
|
||||||
auto post = db.posts().query()
|
auto post = db.posts().query()
|
||||||
->setWhete(Post::idField() == 1)
|
->setWhere(Post::idField() == 1)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if(post)
|
if(post)
|
||||||
|
|
@ -26,14 +26,14 @@ else
|
||||||
## Sorting result
|
## Sorting result
|
||||||
```cpp
|
```cpp
|
||||||
auto posts = db.posts().query()
|
auto posts = db.posts().query()
|
||||||
->whete(Post::idField() == 1)
|
->where(Post::idField() == 1)
|
||||||
->orderBy(Post::idField())
|
->orderBy(Post::idField())
|
||||||
->toList();
|
->toList();
|
||||||
```
|
```
|
||||||
Also you can sort descending by adding **!** to field name
|
Also you can sort descending by adding **!** to field name
|
||||||
```cpp
|
```cpp
|
||||||
auto posts = db.posts().query()
|
auto posts = db.posts().query()
|
||||||
->whete(Post::idField() == 1)
|
->where(Post::idField() == 1)
|
||||||
->orderBy(!Post::idField())
|
->orderBy(!Post::idField())
|
||||||
->toList();
|
->toList();
|
||||||
```
|
```
|
||||||
|
|
@ -64,4 +64,4 @@ Or
|
||||||
auto post = db.posts().query()
|
auto post = db.posts().query()
|
||||||
->where(Post::idField().in({1, 2, 3, 4}) || Post::isAccepted())
|
->where(Post::idField().in({1, 2, 3, 4}) || Post::isAccepted())
|
||||||
->first();
|
->first();
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue