{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2020-05-30T05:47:50Z","object_id":{"id":2015,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_tkvstore","title":"mod_tkvstore","uri":"https:\/\/zotonic.com\/id\/2015"},"seq":1000000}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"references":{"objects":[{"created":"2020-05-30T05:47:50Z","object_id":{"id":2015,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_tkvstore","title":"mod_tkvstore","uri":"https:\/\/zotonic.com\/id\/2015"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"refers":{"objects":[{"created":"2026-09-09T13:48:13Z","object_id":{"id":2015,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_tkvstore","title":"mod_tkvstore","uri":"https:\/\/zotonic.com\/id\/2015"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"relation":{"objects":[{"created":"2020-05-30T05:47:50Z","object_id":{"id":2015,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_tkvstore","title":"mod_tkvstore","uri":"https:\/\/zotonic.com\/id\/2015"},"seq":1000000}],"predicate":{"id":303,"is_a":["meta","predicate"],"name":"relation","title":{"_type":"trans","tr":{"nl":"Relatie","en":"Relation"}},"uri":"http:\/\/purl.org\/dc\/terms\/relation"}},"subject":{"objects":[{"created":"2026-09-09T13:48:13Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":3},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2631,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_database","title":"Database","uri":"https:\/\/zotonic.com\/id\/2631"},"seq":4},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2643,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_query","title":"Query","uri":"https:\/\/zotonic.com\/id\/2643"},"seq":5},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2665,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_structured_data","title":"Structured data","uri":"https:\/\/zotonic.com\/id\/2665"},"seq":6}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2014,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2014"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_model_model_tkvstore","page_url":{"en":"https:\/\/zotonic.com\/docs\/2014\/tkvstore","x-default":"https:\/\/zotonic.com\/docs\/2014\/tkvstore"},"preview_url":null,"resource":{"version":4030,"pivot_location_lat":null,"title":"tkvstore","is_authoritative":true,"body":"<p>Simple read-only interface to the typed key-value store of <a href=\"\/id\/doc_module_mod_tkvstore\" class=\"doc-reference doc-reference-module\"><code>module#mod_tkvstore<\/code><\/a>. To get a value\nfrom the store: use m.tkvstore.type.key, like this:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{% print m.tkvstore.keytype.examplekey %}\n<\/code><\/pre>\n<p>When the key is not a literal value but a variable or a number, use the following notation:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{% print m.tkvstore.keytype[keyvar] %}\n<\/code><\/pre>\n<p>To store data in a key, use <code>m_tkvstore:put\/4<\/code>, as follows:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">m_tkvstore:put(KeyType, KeyVar, Value, Context).\n<\/code><\/pre>\n<p>For instance, from within Erlang, let&#39;s store edge data for a given edge id, 3434:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">Edgeid = 3434,\nValue = &lt;&lt;&quot;Hello&quot;&gt;&gt;,\nm_tkvstore:put(edge_data, EdgeId, Value, Context).\n<\/code><\/pre>\n<p>Now, to retrieve it in the template, do the following:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{{ m.tkvstore.edge_data[3434] }}\n<\/code><\/pre>\n<p>This will output the string <code>Hello<\/code>.<\/p>\n<p>Note that the value can be any type: not only a simple string but also a list, tuple, or any other Erlang composite type.<\/p>\n<h2>Available Model API Paths<\/h2>\n<table class=\"table\"><thead><tr><th>Method<\/th><th>Path pattern<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>get<\/code><\/td><td><code>\/+type\/+key\/...<\/code><\/td><td>Return admin-only typed-key value from <code>tkvstore<\/code> row (<code>type = +type<\/code>, <code>key = +key<\/code>), yielding stored <code>props<\/code> term or <code>undefined<\/code> when missing.<\/td><\/tr><\/tbody><\/table>\n<p><code>\/+name<\/code> marks a variable path segment. A trailing <code>\/...<\/code> means extra path segments are accepted for further lookups.<\/p>","slug":"tkvstore","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"5cffd39ffe8a6db592cb255b42743162a9e75ed8224317f904b3f5f3fea5c2cc","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":"apps\/zotonic_mod_tkvstore\/src\/models\/m_tkvstore.erl","publication_start":"2023-06-24T08:18:01Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_tkvstore\/src\/models\/m_tkvstore.erl","pivot_location_lng":null,"doc_source_kind":"model","name":"doc_model_model_tkvstore","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:50Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_tkvstore","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"a9af6256d16f0717b59ea8dcf2a2e0565573bdd4\n","erlang_module":"m_tkvstore","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-14T14:01:09Z","title_slug":"tkvstore"},"uri":"https:\/\/zotonic.com\/id\/2014","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2014"}},"status":"ok"}