Stroika Library
3.0d18
Help-Home
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
9
#include "
Stroika/Foundation/Characters/String.h
"
10
#include "Stroika/Foundation/Containers/Mapping.h"
11
#include "
Stroika/Foundation/DataExchange/VariantValue.h
"
12
13
/**
14
* \file
15
*
16
* \note Code-Status: <a href="Code-Status.md#Alpha">Alpha</a>
17
*/
18
19
namespace
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
*/
28
using
Document
=
Mapping<String, VariantValue>
;
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. Its value is "_id" (in mongodb, but in this API, its "id")
40
*
41
* \note dont want to hardwire queer choice of mongodb, but dont want to have todo a lot of needless mapping/translation later.
42
* \note the VALUE associated with this key is of type IDType.
43
*/
44
static
inline
const
String
kID
=
"id"
sv;
45
46
}
47
48
/*
49
********************************************************************************
50
***************************** Implementation Details ***************************
51
********************************************************************************
52
*/
53
#include "Document.inl"
54
55
#endif
/*_Stroika_Foundation_Database_Document_Document_h_*/
Stroika::Foundation::Database::Document::kID
static const String kID
Definition
Document.h:44
VariantValue.h
String.h
Stroika::Foundation::Characters::String
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition
String.h:201
Stroika::Foundation::Containers::Mapping
Definition
Library/Sources/Stroika/Foundation/Containers/Mapping.h:114
Library
Sources
Stroika
Foundation
Database
Document
Document.h
Generated by
1.9.8