File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed
docs/06-concepts/06-database Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,12 @@ Two special characters enables matching against partial entries.
130130- ** ` % ` ** Matching any sequence of character.
131131- ** ` _ ` ** Matching any single character.
132132
133- | String | Matcher | Is matching |
134- | ------ | -------- | ----------- |
135- | abc | a% | true |
136- | abc | \_ b% | true |
137- | abc | a_c | true |
138- | abc | b\_ | false |
133+ | String | Matcher | Is matching |
134+ | ------ | ------- | ----------- |
135+ | abc | a% | true |
136+ | abc | \_ b% | true |
137+ | abc | a_c | true |
138+ | abc | b\_ | false |
139139
140140We use like to match against a partial string.
141141
@@ -209,6 +209,28 @@ await User.db.find(
209209
210210In the example we fetch all users that has a name that starts with A _ or_ B.
211211
212+ The ` ~ ` operator is used to negate an expression with a ` not ` operation.
213+
214+ ``` dart
215+ await User.db.find(
216+ session,
217+ where: (t) => ~t.name.equals('Alice')
218+ );
219+ ```
220+
221+ In the example we fetch all users that do _ not_ have the name "Alice".
222+
223+ The ` ~ ` operator can also be used with more complex expressions:
224+
225+ ``` dart
226+ await User.db.find(
227+ session,
228+ where: (t) => ~(t.name.like('A%') | t.age > 25)
229+ );
230+ ```
231+
232+ In the example we fetch all users that do _ not_ have a name starting with "A" _ and_ are _ not_ older than 25.
233+
212234### Vector distance operators
213235
214236All vector field types support specialized distance operations for similarity search. Available vector distance operations:
You can’t perform that action at this time.
0 commit comments