29
29
@file
30
30
Declarations for CRUD operations on document collections.
31
31
32
- Classes declared here represent CRUD operations on a given document
32
+ Classes declared here represent CRUD operations on a document
33
33
collection. An Object of a class such as CollectionAdd represents
34
- a "yet-to-be-executed" operation and stores all the parameters for the
34
+ a "yet-to-be-executed" operation and stores all the parameters of the
35
35
operation. The operation is sent to server for execution only when
36
36
`execute()` method is called.
37
37
51
51
CRUD operation objects have methods which can modify the operation
52
52
before it gets executed. For example `CollectionAdd::add()`
53
53
appends a document to the list of documents that should be added
54
- by given CollectionAdd operation. These methods can be chained
54
+ by the given CollectionAdd operation. These methods can be chained
55
55
as allowed by the fluent API grammar.
56
56
57
+ @internal
58
+
57
59
The order of fluent API calls is expressed by base classes, such as
58
60
Collection_find_base, which are composed from CRUD templates defined
59
61
in crud.h. The order of templates determines the allowed order of fluent
@@ -104,17 +106,17 @@ struct Collection_add_base
104
106
105
107
106
108
/* *
107
- Operation which adds documents to a collection.
109
+ An operation which adds documents to a collection.
108
110
109
111
Documents to be added by this operation are specified with various variants
110
112
of `add()` method.
111
113
112
114
Each document must have a unique identifier which is stored in `_id`
113
115
field of the document. Document identifiers are character strings no longer
114
116
than 32 characters. If added document does not have `_id` field, a unique
115
- identifier is generated for it. Document identifier generated by given
117
+ identifier is generated for it. Document identifier generated by a given
116
118
collection add operation can be examined using `Result::getDocumentIds()`
117
- method. Generated document identifiers are string of 32 hexadecimal digits,
119
+ method. Generated document identifiers are strings of 32 hexadecimal digits,
118
120
like this one `0512020981044082E6119DFA0E4C0584`.
119
121
120
122
@note Generated document identifiers are based on UUIDs but they are not
@@ -140,7 +142,7 @@ DLL_WARNINGS_POP
140
142
public:
141
143
142
144
/* *
143
- Create empty add operation for a given collection.
145
+ Create an empty add operation for the given collection.
144
146
*/
145
147
146
148
CollectionAdd (Collection &coll);
@@ -157,9 +159,7 @@ DLL_WARNINGS_POP
157
159
158
160
159
161
/* *
160
- Add all documents from a range defined by two iterators. These
161
- iterators should return a document object of one of accepted types
162
- (as given by the is_doc_type<> trait).
162
+ Add all documents from a range defined by two iterators.
163
163
*/
164
164
165
165
template <typename It>
@@ -241,7 +241,7 @@ struct Collection_remove_base
241
241
242
242
243
243
/* *
244
- Class representing operation which removes documents from a collection.
244
+ An operation which removes documents from a collection.
245
245
246
246
@ingroup devapi_op
247
247
@@ -257,17 +257,19 @@ class PUBLIC_API CollectionRemove
257
257
public:
258
258
259
259
/* *
260
- Create empty remove operation for a given collection.
260
+ Create an empty remove operation for the given collection.
261
261
*/
262
262
263
263
CollectionRemove (Collection &coll);
264
264
265
265
/* *
266
- Create remove operation for given collection and documents
267
- selected by an expression.
266
+ Create an operation which removes selected documnets from the given
267
+ collection.
268
+
269
+ Documents to be removed are specified by the given Boolean expression.
268
270
*/
269
271
270
- CollectionRemove (Collection &coll, const string& );
272
+ CollectionRemove (Collection &coll, const string &expr );
271
273
272
274
273
275
CollectionRemove (const internal::Collection_remove_cmd &other)
@@ -308,7 +310,7 @@ struct Collection_find_base
308
310
309
311
310
312
/* *
311
- Operation which returns all or selected documents from a collection.
313
+ An operation which returns all or selected documents from a collection.
312
314
313
315
@ingroup devapi_op
314
316
*/
@@ -327,17 +329,19 @@ DLL_WARNINGS_POP
327
329
public:
328
330
329
331
/* *
330
- Create operation which returns all documents from a collection.
332
+ Create an operation which returns all documents from the given collection.
331
333
*/
332
334
333
335
CollectionFind (Collection &coll);
334
336
335
337
/* *
336
- Create operation which returns all documents from a collection
337
- which satisfy given criteria.
338
+ Create an operation which returns selected documents from the given
339
+ collection.
340
+
341
+ Documents to be returned are specified by the given Boolean expression.
338
342
*/
339
343
340
- CollectionFind (Collection &coll, const string& );
344
+ CollectionFind (Collection &coll, const string &expr );
341
345
342
346
343
347
CollectionFind (const internal::Collection_find_cmd &other)
@@ -354,7 +358,7 @@ DLL_WARNINGS_POP
354
358
public:
355
359
356
360
/* *
357
- Specify projection for the documents found by this query .
361
+ Specify a projection for the documents returned by this operation .
358
362
359
363
Projection is either a single document expression given by `expr(<string>)`
360
364
or a list (or collection) of strings of the form
@@ -415,7 +419,7 @@ struct Collection_replace_base
415
419
{};
416
420
417
421
/*
418
- Operation which replaces a document, using the id by a new one
422
+ An operation which replaces a single document with a new one.
419
423
*/
420
424
421
425
class PUBLIC_API CollectionReplace
@@ -456,7 +460,7 @@ class PUBLIC_API CollectionReplace
456
460
457
461
458
462
/* *
459
- Operation which modifies all or selected documents in a collection.
463
+ An operation which modifies all or selected documents in a collection.
460
464
461
465
@ingroup devapi_op
462
466
*/
@@ -467,7 +471,12 @@ class PUBLIC_API CollectionModify
467
471
468
472
public:
469
473
470
- // / Create operation which modifies selected documents in a collection.
474
+ /* *
475
+ Create an operation which modifies selected documents in the given
476
+ collection.
477
+
478
+ Documents to be modified are specified by the given Boolean expression.
479
+ */
471
480
472
481
CollectionModify (Collection &base, const string &expr);
473
482
@@ -484,10 +493,11 @@ class PUBLIC_API CollectionModify
484
493
485
494
486
495
/* *
487
- Set a given field in a document to the given value.
496
+ Set the given field in a document to the given value.
488
497
489
- Field is given by a document path. The value can be either a direct literal
490
- or an expression given by `expr(<string>)`, evaluated on the server.
498
+ The field is given by a document path. The value can be either a direct
499
+ literal or an expression given as `expr(<string>)`, to be evaluated on
500
+ the server.
491
501
*/
492
502
493
503
CollectionModify& set (const Field &field, internal::ExprValue &&val)
@@ -500,7 +510,7 @@ class PUBLIC_API CollectionModify
500
510
}
501
511
502
512
/* *
503
- Unset a given field in a document.
513
+ Remove the given field from a document.
504
514
505
515
The field is given by a document path.
506
516
*/
@@ -515,7 +525,7 @@ class PUBLIC_API CollectionModify
515
525
}
516
526
517
527
/* *
518
- Insert value into an array field of a document.
528
+ Insert a value into an array field of a document.
519
529
520
530
The `field` parameter should be a document path pointing at a location
521
531
inside an array field. The given value is inserted at this position.
@@ -531,7 +541,7 @@ class PUBLIC_API CollectionModify
531
541
}
532
542
533
543
/* *
534
- Append value to an array field of a document.
544
+ Append a value to an array field of a document.
535
545
536
546
The `field` parameter should be a document path pointing at an array
537
547
field inside the document. The given value is appended at the end of the
@@ -548,10 +558,10 @@ class PUBLIC_API CollectionModify
548
558
}
549
559
550
560
/* *
551
- Delete element from an array field of a document.
561
+ Delete an element from an array field of a document.
552
562
553
563
The `field` parameter should be a document path pointing at a location
554
- inside an array field. The element at indicated location is removed from
564
+ inside an array field. The element at the indicated location is removed from
555
565
the array.
556
566
*/
557
567
0 commit comments