Skip to content

Commit 55db1c5

Browse files
committed
WL#10008 (Document UUIDs) Documentation.
1 parent 7f875c7 commit 55db1c5

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

include/devapi/collection_crud.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,17 @@ namespace internal {
201201
Class which defines various variants of `add()` method.
202202
203203
This class defines `add()` methods that append new documents to the
204-
list of documents that should be inserted by a CollectionAdd operation.
204+
list of documents that should be inserted by a `CollectionAdd` operation.
205205
Documents can be specified as JSON strings or DbDoc instances. Several
206206
documents can be added in a single call to `add()`.
207207
208+
@cond IGNORE
208209
Template is parametrized by return type of the `add()` method which
209210
is different in case of `CollectionAddBase` and `CollcetionAdd`.
210211
This return type is either `CollectionAdd` or reference to
211212
`CollectionAdd`, respectively. In either case `CollectionAdd::do_add()`
212213
method is used to append documents to the list.
214+
@endcond
213215
*/
214216

215217
template<class AddOp>
@@ -341,10 +343,26 @@ namespace internal {
341343
/**
342344
Operation which adds documents to a collection.
343345
346+
Documents to be added by this operation are specified with various variants
347+
of `add()` method.
348+
349+
Each document must have a unique identifier which is stored in `_id`
350+
filed of the document. Document identifiers are character strings no longer
351+
than 32 characters. If added document does not have `_id` field, a unique
352+
identifier will be generated for it. Document identifier generated by given
353+
collection add operation can be examined using `Result::getDocumentIds()`
354+
method. Generated document identifiers are string of 32 hexadecimal digits,
355+
like this one `0512020981044082E6119DFA0E4C0584`.
356+
357+
@note Generated document identifiers are based on UUIDs but they are not
358+
valid UUIDs (fields are reversed).
359+
360+
@cond IGNORE
344361
The various `add()` methods defined by `CollectionAddInterface`
345362
call `do_add()` to append documents to the list one by one. This
346363
method, in turn, passes these documents to the internal
347364
implementation object.
365+
@endcond
348366
349367
@ingroup devapi_op
350368
*/

include/mysql_devapi.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ class PUBLIC_API SessionSettings
960960
Possible connection options are:
961961
962962
- `ssl-enable` : use TLS connection
963-
- `ssl-ca=`<path> : path to a PEM file specifying trusted root certificates
963+
- `ssl-ca=`path : path to a PEM file specifying trusted root certificates
964964
965965
Specifying `ssl-ca` option implies `ssl-enable`.
966966
*/
@@ -1254,8 +1254,16 @@ namespace internal {
12541254

12551255
Schema getSchema(const string&, bool check_existence = false);
12561256

1257+
/**
1258+
Get the default schema specified when session was created.
1259+
*/
1260+
12571261
Schema getDefaultSchema();
12581262

1263+
/**
1264+
Get the name of the default schema specified when session was created.
1265+
*/
1266+
12591267
string getDefaultSchemaName();
12601268

12611269
/**

include/mysql_xapi.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ mysqlx_get_session(const char *host, int port, const char *user,
437437
Possible connection options are:
438438
439439
- `ssl-enable` : use TLS connection
440-
- `ssl-ca=`<path> : path to a PEM file specifying trusted root certificates
440+
- `ssl-ca=`path : path to a PEM file specifying trusted root certificates
441441
442442
Specifying `ssl-ca` option implies `ssl-enable`.
443443
@@ -1024,8 +1024,18 @@ mysqlx_collection_find(mysqlx_collection_t *collection, const char *criteria);
10241024
NULL is returned only in case of an error. The error details
10251025
can be obtained using `mysqlx_error()` function
10261026
1027-
@see `mysqlx_collection_add_new()` for additional information about
1028-
adding documents to a collection.
1027+
Each document must have a unique identifier which is stored in `_id`
1028+
filed of the document. Document identifiers are character strings no longer
1029+
than 32 characters. If added document does not have `_id` field, a unique
1030+
identifier will be generated for it. Document identifier generated by given
1031+
collection add operation can be examined using `mysqlx_fetch_doc_id()`
1032+
function. Generated document identifiers are strings of 32 hexadecimal digits,
1033+
like this one `0512020981044082E6119DFA0E4C0584`.
1034+
1035+
@note Generated document identifiers are based on UUIDs but they are not
1036+
valid UUIDs (fields are reversed).
1037+
1038+
@see `mysqlx_collection_add_new()`
10291039
10301040
@ingroup xapi_coll
10311041
*/

0 commit comments

Comments
 (0)