Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit d2a22a4

Browse files
author
Hans Kristian Flaatten
committed
docs(readme): document $in and $nin query operators
1 parent a31b212 commit d2a22a4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ useful when building an API and accepting various user specificed queries.
1515
* Blacklisted query parameters
1616
* Whitelisted query parameters
1717
* Basic operators
18-
* `$ne`
18+
* `$eq`
1919
* `$gt`
2020
* `$lt`
21-
* `$regex`
21+
* `$ne`
22+
* `$in`
23+
* `$nin`
2224
* `$exists`
25+
* `$regex`
2326

2427
| operation | query string | query object |
2528
|-----------|---------------|--------------|
@@ -32,6 +35,8 @@ useful when building an API and accepting various user specificed queries.
3235
| starts with | `?foo=^bar` | `{ foo: { $regex: "^foo", $options: "i" }}` |
3336
| ends with | `?foo=$bar` | `{ foo: { $regex: "foo$", $options: "i" }}` |
3437
| contains | `?foo=~bar` | `{ foo: { $regex: "foo", $options: "i" }}` |
38+
| in array | `?foo[]=bar&foo[]=baz` | `{ foo: { $in: ['bar', 'baz'] }}` |
39+
| not in array | `?foo[]=!bar&foo[]=!baz` | `{ foo: { $nin: ['bar', 'baz'] }}` |
3540

3641
* Geospatial operators
3742
* `$geoWithin` (polygon)

0 commit comments

Comments
 (0)