TAC = Module store upsert forcer _id #1

Closed
opened 2023-02-22 22:24:09 +01:00 by afornerot · 2 comments
Owner

Dans certains il pourrait être utile de maitriser la valeur de _id

Exemple
var obj = store.upsert(ctx, "Config", {"_id": "version", "value": "0.0.0"});

Dans ce cas la methode m'insère bien un document car _id=version n'existe pas
map[_createdAt:2023-02-22 21:16:58.415454206 +0000 UTC _id:01GSXFS4NFE1GDFH7Z4C7Q5GM9 _updatedAt:2023-02-22 21:16:58.415454206 +0000 UTC value:0.0.0]

Mais serait-il possible de plutot utiliser l'id transmis plutot que de me généré un uuid ?

Dans certains il pourrait être utile de maitriser la valeur de _id Exemple `var obj = store.upsert(ctx, "Config", {"_id": "version", "value": "0.0.0"});` Dans ce cas la methode m'insère bien un document car _id=version n'existe pas `map[_createdAt:2023-02-22 21:16:58.415454206 +0000 UTC _id:01GSXFS4NFE1GDFH7Z4C7Q5GM9 _updatedAt:2023-02-22 21:16:58.415454206 +0000 UTC value:0.0.0]` Mais serait-il possible de plutot utiliser l'id transmis plutot que de me généré un uuid ?
afornerot added the
Type = Tâche
label 2023-02-22 22:24:09 +01:00
Author
Owner

J'ai l'impression qu'il y a un pb quand meme
J'ai forcer la valeur de l'id via DBBrowser
J'ai reupsert
var obj = store.upsert(ctx, "Config", {"_id": "version", "value": "0.0.0"});

Il me regen un enregistrement
map[_createdAt:2023-02-22 21:45:11.719120133 +0000 UTC _id:version _updatedAt:2023-02-22 21:45:11.719120133 +0000 UTC value:0.0.0]

Mon _id=version est pourtant bien là

  "query": SELECT id, data, created_at, updated_at 
           		FROM documents 
           		WHERE collection = $1 AND (1 = 1)
2023-02-22 21:49:46.648

[DEBUG]	<console.go:36>	

[map[_createdAt:2023-02-22 21:45:11.719120133 +0000 UTC _id:version _updatedAt:2023-02-22 21:45:11.719120133 +0000 UTC value:0.0.0]

map[_createdAt:2023-02-22 21:49:46.634302697 +0000 UTC _id:01GSXHN6RABE6ZVGWVF993TEHH _updatedAt:2023-02-22 21:49:46.634302697 +0000 UTC value:0.0.0]]
J'ai l'impression qu'il y a un pb quand meme J'ai forcer la valeur de l'id via DBBrowser J'ai reupsert `var obj = store.upsert(ctx, "Config", {"_id": "version", "value": "0.0.0"});` Il me regen un enregistrement ` map[_createdAt:2023-02-22 21:45:11.719120133 +0000 UTC _id:version _updatedAt:2023-02-22 21:45:11.719120133 +0000 UTC value:0.0.0]` Mon _id=version est pourtant bien là ``` "query": SELECT id, data, created_at, updated_at FROM documents WHERE collection = $1 AND (1 = 1) 2023-02-22 21:49:46.648 [DEBUG] <console.go:36> [map[_createdAt:2023-02-22 21:45:11.719120133 +0000 UTC _id:version _updatedAt:2023-02-22 21:45:11.719120133 +0000 UTC value:0.0.0] map[_createdAt:2023-02-22 21:49:46.634302697 +0000 UTC _id:01GSXHN6RABE6ZVGWVF993TEHH _updatedAt:2023-02-22 21:49:46.634302697 +0000 UTC value:0.0.0]] ```
Author
Owner

Je ferme bug corrigé avec la dernière version du client

Je ferme bug corrigé avec la dernière version du client
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: arcad/edge#1
No description provided.