From 08691f3a1fa798d0480a91add296b7a363167099 Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Thu, 10 Dec 2020 13:12:40 +0100 Subject: [PATCH 1/2] Update Datastore interface Add new locked field syntax --- docs/interfaces/datastore-service.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/interfaces/datastore-service.txt b/docs/interfaces/datastore-service.txt index 582243e6f..7d512037c 100644 --- a/docs/interfaces/datastore-service.txt +++ b/docs/interfaces/datastore-service.txt @@ -72,7 +72,7 @@ Interface WriteRequest { locked_fields: { : Position; : Position; - : Position; + : Position | CollectionFieldLock; } } @@ -104,6 +104,11 @@ Interface DeleteEvent { fqid: Fqid; } +Interface CollectionFieldLock { + position: Position; + filter: Filter; +} + // Note: The modified fqfields include: // - all updated fqfields // - all deleted fqfields @@ -213,16 +218,22 @@ get_all(collection: Collection, mapped_fields?: Field[], get_deleted_models?: De */ get_everything(get_deleted_models?: DeletedModelsBehaviour): Map; +interface FilterResponse { + max_position: Position; + data: Map>; +} + /** * Returns all models of one collection that satisfy the filter condition. * Url: POST to /internal/datastore/reader/filter * + * The global max position of the datastore is returned next the the filtered data. * This method does not take a position and can not be used when browsing the history. * * @returns see get_many * @throws InvalidFormat */ -filter(collection: Collection, filter: Filter, mapped_fields?: Field[]): Map> +filter(collection: Collection, filter: Filter, mapped_fields?: Field[]): FilterResponse /** * Url: POST to /internal/datastore/reader/exists From 5844eabb952590633b927aa3969497f75341f256 Mon Sep 17 00:00:00 2001 From: Joshua Sangmeister Date: Tue, 12 Jan 2021 14:58:21 +0100 Subject: [PATCH 2/2] more docs & rename max_position --- docs/interfaces/datastore-service.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/interfaces/datastore-service.txt b/docs/interfaces/datastore-service.txt index 7d512037c..b684ad9a0 100644 --- a/docs/interfaces/datastore-service.txt +++ b/docs/interfaces/datastore-service.txt @@ -104,6 +104,10 @@ Interface DeleteEvent { fqid: Fqid; } +// Collection fields can not only be locked to a specific position, but also filtered +// first, e.g. when selecting all models from a specific meeting. WARNING: the filter +// should always contain an equals check with the meeting_id, since this will be +// indexed. Other filters can lead to long query times. Interface CollectionFieldLock { position: Position; filter: Filter; @@ -219,7 +223,7 @@ get_all(collection: Collection, mapped_fields?: Field[], get_deleted_models?: De get_everything(get_deleted_models?: DeletedModelsBehaviour): Map; interface FilterResponse { - max_position: Position; + position: Position; data: Map>; }