Stroika Library 3.0d20
 
Loading...
Searching...
No Matches
Document.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Database_Document_Document_h_
5#define _Stroika_Foundation_Database_Document_Document_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
10#include "Stroika/Foundation/Containers/Mapping.h"
12
13/**
14 * \file
15 *
16 * \note Code-Status: <a href="Code-Status.md#Alpha">Alpha</a>
17 */
18
19namespace Stroika::Foundation::Database::Document {
20
21 using Characters::String;
22 using Containers::Mapping;
23 using DataExchange::VariantValue;
24
25 /**
26 * In a document database, a document is a mapping of field names to values (slightly different than just a VariantValue)
27 */
29
30 /**
31 * 'Type' used for value of 'id' field.
32 *
33 * \note - we considered using GUID, but String is more flexible given that different systems (e.g. XML, MongoDB etc) all might
34 * have different requirements on how to format/size/rules for those IDs. String is lingua-franca.
35 */
36 using IDType = String;
37
38 /**
39 * \note this special value kID is used to identify the ID field in a document (Mapping::KeyType).
40 *
41 * \note mongodb uses "_id", but in this API, uses "id", so the Stroika/mongodb layer must translate
42 * \note dont want to hardwire queer choice of mongodb, but dont want to have todo a lot of needless mapping/translation later.
43 * \note the VALUE associated with this key is of type IDType.
44 */
45 static inline const String kID = "id"sv;
46
47}
48
49/*
50 ********************************************************************************
51 ***************************** Implementation Details ***************************
52 ********************************************************************************
53 */
54#include "Document.inl"
55
56#endif /*_Stroika_Foundation_Database_Document_Document_h_*/
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition String.h:201