You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58
Original file line number
Diff line number
Diff line change
@@ -202,6 +202,29 @@ const config = {
202
202
};
203
203
```
204
204
205
+
206
+
## Additional properties
207
+
208
+
<table>
209
+
<thead>
210
+
<tr>
211
+
<th width="160">Property</th>
212
+
<th width="90">Type</th>
213
+
<th>Default</th>
214
+
<th>Description</th>
215
+
</tr>
216
+
</thead>
217
+
<tbody>
218
+
<tr>
219
+
<td>allowExtendedOperators</td>
220
+
<td>Boolean</td>
221
+
<td><code>false</code></td>
222
+
<td>Set to <code>true</code> to enable using Postgres operators such as <code>contains</code> which is used to perform filter on postgres array type field.</td>
223
+
</tr>
224
+
</tbody>
225
+
</table>
226
+
227
+
205
228
## Defining models
206
229
207
230
LoopBack allows you to specify some database settings through the model definition and/or the property definition. These definitions would be mapped to the database. Please check out the CLI [`lb4 model`](https://loopback.io/doc/en/lb4/Model-generator.html) for generating LB4 models. The following is a typical LoopBack 4 model that specifies the schema, table and column details through model definition and property definitions:
@@ -412,6 +435,12 @@ details on LoopBack's data types.
412
435
VARCHAR2<br/>
413
436
Default length is 1024
414
437
</td>
438
+
</tr>
439
+
<tr>
440
+
<td>String[]</td>
441
+
<td>
442
+
VARCHAR2[]
443
+
</td>
415
444
</tr>
416
445
<tr>
417
446
<td>Number</td>
@@ -531,6 +560,35 @@ CustomerRepository.find({
531
560
});
532
561
```
533
562
563
+
## Querying Postgres Array type fields
564
+
565
+
**Note** The fields you are querying should be setup to use the postgresql array data type - see Defining models
566
+
567
+
Assuming a model such as this:
568
+
569
+
```ts
570
+
@property({
571
+
type: ['string'],
572
+
postgresql: {
573
+
dataType:'varchar[]',
574
+
},
575
+
})
576
+
categories?: string[];
577
+
```
578
+
579
+
You can query the tags fields via setting allowExtendedOperators to true
0 commit comments