This project is a sample for document store database, using:
- Postgresql
- Marten
it shows:
- Sub class (
Issue
) - Sub array (
Assignee
) - Inheritance (
Smurf
) - Indexing sub array (
Mapping
) - Indexing text (
TextSearch
)
need
pg_trgm
extension
- marten identity
- hi-lo algorithm
int/long
vsuuid/guid
- stackoverflow
- usage => Integers Internal, UUIDs External
-- rename column
update example
set js = js - 'old' || jsonb_build_object('new', js->'old')
where js ? 'old'
-- transform array<T> to T
update example
set js = jsonb_set(
js #- '{prefixPath,old}',
'{prefixPath,new}',
js #> '{prefixPath,old,0}') -- take only first item
where js ? '{prefixPath,old}'