@@ -50,8 +50,8 @@ module Extensions =
50
50
WithProps.Count.all tableName ( Sql.existingConnection conn)
51
51
52
52
/// Count matching documents using a JSON field comparison query (->> =)
53
- member conn.countByField tableName fieldName op ( value : obj ) =
54
- WithProps.Count.byField tableName fieldName op value ( Sql.existingConnection conn)
53
+ member conn.countByField tableName field =
54
+ WithProps.Count.byField tableName field ( Sql.existingConnection conn)
55
55
56
56
/// Count matching documents using a JSON containment query (@>)
57
57
member conn.countByContains tableName criteria =
@@ -66,8 +66,8 @@ module Extensions =
66
66
WithProps.Exists.byId tableName docId ( Sql.existingConnection conn)
67
67
68
68
/// Determine if documents exist using a JSON field comparison query (->> =)
69
- member conn.existsByField tableName fieldName op ( value : obj ) =
70
- WithProps.Exists.byField tableName fieldName op value ( Sql.existingConnection conn)
69
+ member conn.existsByField tableName field =
70
+ WithProps.Exists.byField tableName field ( Sql.existingConnection conn)
71
71
72
72
/// Determine if documents exist using a JSON containment query (@>)
73
73
member conn.existsByContains tableName criteria =
@@ -86,8 +86,8 @@ module Extensions =
86
86
WithProps.Find.byId< 'TKey, 'TDoc> tableName docId ( Sql.existingConnection conn)
87
87
88
88
/// Retrieve documents matching a JSON field comparison query (->> =)
89
- member conn.findByField < 'TDoc > tableName fieldName op ( value : obj ) =
90
- WithProps.Find.byField< 'TDoc> tableName fieldName op value ( Sql.existingConnection conn)
89
+ member conn.findByField < 'TDoc > tableName field =
90
+ WithProps.Find.byField< 'TDoc> tableName field ( Sql.existingConnection conn)
91
91
92
92
/// Retrieve documents matching a JSON containment query (@>)
93
93
member conn.findByContains < 'TDoc > tableName ( criteria : obj ) =
@@ -98,8 +98,8 @@ module Extensions =
98
98
WithProps.Find.byJsonPath< 'TDoc> tableName jsonPath ( Sql.existingConnection conn)
99
99
100
100
/// Retrieve the first document matching a JSON field comparison query (->> =); returns None if not found
101
- member conn.findFirstByField < 'TDoc > tableName fieldName op ( value : obj ) =
102
- WithProps.Find.firstByField< 'TDoc> tableName fieldName op value ( Sql.existingConnection conn)
101
+ member conn.findFirstByField < 'TDoc > tableName field =
102
+ WithProps.Find.firstByField< 'TDoc> tableName field ( Sql.existingConnection conn)
103
103
104
104
/// Retrieve the first document matching a JSON containment query (@>); returns None if not found
105
105
member conn.findFirstByContains < 'TDoc > tableName ( criteria : obj ) =
@@ -122,8 +122,8 @@ module Extensions =
122
122
WithProps.Patch.byId tableName docId patch ( Sql.existingConnection conn)
123
123
124
124
/// Patch documents using a JSON field comparison query in the WHERE clause (->> =)
125
- member conn.patchByField tableName fieldName op ( value : obj ) ( patch : 'TPatch ) =
126
- WithProps.Patch.byField tableName fieldName op value patch ( Sql.existingConnection conn)
125
+ member conn.patchByField tableName field ( patch : 'TPatch ) =
126
+ WithProps.Patch.byField tableName field patch ( Sql.existingConnection conn)
127
127
128
128
/// Patch documents using a JSON containment query in the WHERE clause (@>)
129
129
member conn.patchByContains tableName ( criteria : 'TCriteria ) ( patch : 'TPatch ) =
@@ -133,13 +133,29 @@ module Extensions =
133
133
member conn.patchByJsonPath tableName jsonPath ( patch : 'TPatch ) =
134
134
WithProps.Patch.byJsonPath tableName jsonPath patch ( Sql.existingConnection conn)
135
135
136
+ /// Remove fields from a document by the document's ID
137
+ member conn.removeFieldsById tableName ( docId : 'TKey ) fieldNames =
138
+ WithProps.RemoveFields.byId tableName docId fieldNames ( Sql.existingConnection conn)
139
+
140
+ /// Remove fields from documents via a comparison on a JSON field in the document
141
+ member conn.removeFieldsByField tableName field fieldNames =
142
+ WithProps.RemoveFields.byField tableName field fieldNames ( Sql.existingConnection conn)
143
+
144
+ /// Remove fields from documents via a JSON containment query (@>)
145
+ member conn.removeFieldsByContains tableName ( criteria : 'TContains ) fieldNames =
146
+ WithProps.RemoveFields.byContains tableName criteria fieldNames ( Sql.existingConnection conn)
147
+
148
+ /// Remove fields from documents via a JSON Path match query (@?)
149
+ member conn.removeFieldsByJsonPath tableName jsonPath fieldNames =
150
+ WithProps.RemoveFields.byJsonPath tableName jsonPath fieldNames ( Sql.existingConnection conn)
151
+
136
152
/// Delete a document by its ID
137
153
member conn.deleteById tableName ( docId : 'TKey ) =
138
154
WithProps.Delete.byId tableName docId ( Sql.existingConnection conn)
139
155
140
156
/// Delete documents by matching a JSON field comparison query (->> =)
141
- member conn.deleteByField tableName fieldName op ( value : obj ) =
142
- WithProps.Delete.byField tableName fieldName op value ( Sql.existingConnection conn)
157
+ member conn.deleteByField tableName field =
158
+ WithProps.Delete.byField tableName field ( Sql.existingConnection conn)
143
159
144
160
/// Delete documents by matching a JSON containment query (@>)
145
161
member conn.deleteByContains tableName ( criteria : 'TContains ) =
@@ -209,8 +225,8 @@ type NpgsqlConnectionCSharpExtensions =
209
225
210
226
/// Count matching documents using a JSON field comparison query (->> =)
211
227
[<Extension>]
212
- static member inline CountByField ( conn , tableName , fieldName , op , value : obj ) =
213
- WithProps.Count.byField tableName fieldName op value ( Sql.existingConnection conn)
228
+ static member inline CountByField ( conn , tableName , field ) =
229
+ WithProps.Count.byField tableName field ( Sql.existingConnection conn)
214
230
215
231
/// Count matching documents using a JSON containment query (@>)
216
232
[<Extension>]
@@ -229,8 +245,8 @@ type NpgsqlConnectionCSharpExtensions =
229
245
230
246
/// Determine if documents exist using a JSON field comparison query (->> =)
231
247
[<Extension>]
232
- static member inline ExistsByField ( conn , tableName , fieldName , op , value : obj ) =
233
- WithProps.Exists.byField tableName fieldName op value ( Sql.existingConnection conn)
248
+ static member inline ExistsByField ( conn , tableName , field ) =
249
+ WithProps.Exists.byField tableName field ( Sql.existingConnection conn)
234
250
235
251
/// Determine if documents exist using a JSON containment query (@>)
236
252
[<Extension>]
@@ -254,8 +270,8 @@ type NpgsqlConnectionCSharpExtensions =
254
270
255
271
/// Retrieve documents matching a JSON field comparison query (->> =)
256
272
[<Extension>]
257
- static member inline FindByField < 'TDoc >( conn , tableName , fieldName , op , value : obj ) =
258
- WithProps.Find.ByField< 'TDoc>( tableName, fieldName , op , value , Sql.existingConnection conn)
273
+ static member inline FindByField < 'TDoc >( conn , tableName , field ) =
274
+ WithProps.Find.ByField< 'TDoc>( tableName, field , Sql.existingConnection conn)
259
275
260
276
/// Retrieve documents matching a JSON containment query (@>)
261
277
[<Extension>]
@@ -269,8 +285,8 @@ type NpgsqlConnectionCSharpExtensions =
269
285
270
286
/// Retrieve the first document matching a JSON field comparison query (->> =); returns None if not found
271
287
[<Extension>]
272
- static member inline FindFirstByField < 'TDoc when 'TDoc : null >( conn , tableName , fieldName , op , value : obj ) =
273
- WithProps.Find.FirstByField< 'TDoc>( tableName, fieldName , op , value , Sql.existingConnection conn)
288
+ static member inline FindFirstByField < 'TDoc when 'TDoc : null >( conn , tableName , field ) =
289
+ WithProps.Find.FirstByField< 'TDoc>( tableName, field , Sql.existingConnection conn)
274
290
275
291
/// Retrieve the first document matching a JSON containment query (@>); returns None if not found
276
292
[<Extension>]
@@ -299,8 +315,8 @@ type NpgsqlConnectionCSharpExtensions =
299
315
300
316
/// Patch documents using a JSON field comparison query in the WHERE clause (->> =)
301
317
[<Extension>]
302
- static member inline PatchByField ( conn , tableName , fieldName , op , value : obj , patch : 'TPatch ) =
303
- WithProps.Patch.byField tableName fieldName op value patch ( Sql.existingConnection conn)
318
+ static member inline PatchByField ( conn , tableName , field , patch : 'TPatch ) =
319
+ WithProps.Patch.byField tableName field patch ( Sql.existingConnection conn)
304
320
305
321
/// Patch documents using a JSON containment query in the WHERE clause (@>)
306
322
[<Extension>]
@@ -312,15 +328,35 @@ type NpgsqlConnectionCSharpExtensions =
312
328
static member inline PatchByJsonPath ( conn , tableName , jsonPath , patch : 'TPatch ) =
313
329
WithProps.Patch.byJsonPath tableName jsonPath patch ( Sql.existingConnection conn)
314
330
331
+ /// Remove fields from a document by the document's ID
332
+ [<Extension>]
333
+ static member inline RemoveFieldsById ( conn , tableName , docId : 'TKey , fieldNames ) =
334
+ WithProps.RemoveFields.ById( tableName, docId, fieldNames, Sql.existingConnection conn)
335
+
336
+ /// Remove fields from documents via a comparison on a JSON field in the document
337
+ [<Extension>]
338
+ static member inline RemoveFieldsByField ( conn , tableName , field , fieldNames ) =
339
+ WithProps.RemoveFields.ByField( tableName, field, fieldNames, Sql.existingConnection conn)
340
+
341
+ /// Remove fields from documents via a JSON containment query (@>)
342
+ [<Extension>]
343
+ static member inline RemoveFieldsByContains ( conn , tableName , criteria : 'TContains , fieldNames ) =
344
+ WithProps.RemoveFields.ByContains( tableName, criteria, fieldNames, Sql.existingConnection conn)
345
+
346
+ /// Remove fields from documents via a JSON Path match query (@?)
347
+ [<Extension>]
348
+ static member inline RemoveFieldsByJsonPath ( conn , tableName , jsonPath , fieldNames ) =
349
+ WithProps.RemoveFields.ByJsonPath( tableName, jsonPath, fieldNames, Sql.existingConnection conn)
350
+
315
351
/// Delete a document by its ID
316
352
[<Extension>]
317
353
static member inline DeleteById ( conn , tableName , docId : 'TKey ) =
318
354
WithProps.Delete.byId tableName docId ( Sql.existingConnection conn)
319
355
320
356
/// Delete documents by matching a JSON field comparison query (->> =)
321
357
[<Extension>]
322
- static member inline DeleteByField ( conn , tableName , fieldName , op , value : obj ) =
323
- WithProps.Delete.byField tableName fieldName op value ( Sql.existingConnection conn)
358
+ static member inline DeleteByField ( conn , tableName , field ) =
359
+ WithProps.Delete.byField tableName field ( Sql.existingConnection conn)
324
360
325
361
/// Delete documents by matching a JSON containment query (@>)
326
362
[<Extension>]
0 commit comments