Skip to content

Commit 23398e7

Browse files
committed
Readme.md: Add new operators into operators list
1 parent c222f35 commit 23398e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,14 +634,21 @@ Address.where('latitude.between': [10212, 20000])
634634
```
635635

636636
You are able to filter results on the DynamoDB side and specify conditions for non-key fields.
637-
Following operators are available: `in`, `contains`, `not_contains`:
637+
Following additional operators are available: `in`, `contains`, `not_contains`, `null`, `not_null`:
638638

639639
```ruby
640640
Address.where('city.in': ['London', 'Edenburg', 'Birmingham'])
641641
Address.where('city.contains': ['on'])
642642
Address.where('city.not_contains': ['ing'])
643+
Address.where('postcode.null': false)
644+
Address.where('postcode.not_null': true)
643645
```
644646

647+
**WARNING:** Please take into accout that `NULL` and `NOT_NULL`
648+
operators check attribute presence in a document, not value.
649+
So if attribute `postcode`'s value is `NULL`, `NULL` operator will return false
650+
because attribute exists even if has `NULL` value.
651+
645652
### Consistent Reads
646653

647654
Querying supports consistent reading. By default, DynamoDB reads are eventually consistent: if you do a write and then a read immediately afterwards, the results of the previous write may not be reflected. If you need to do a consistent read (that is, you need to read the results of a write immediately) you can do so, but keep in mind that consistent reads are twice as expensive as regular reads for DynamoDB.

0 commit comments

Comments
 (0)