Litedb insert example github. All SQL commands are supported in new LiteDB.

org Put it into a 1000 loop. ). is there any way to catch why fails? But when I'm inserting/upserting data into LiteDB, it's beeing converted into 2014-01-01 at 07:00 AM - data format is not the problem here, but the strange offset. Constants; namespace LiteDB. в LiteDB. 3. All DateTime values converts to UTC before store and converts back to local on retrieve. Apr 13, 2018 · LiteDB. Or, if you prefer, you can install via NuGet: Install-Package LiteDB. I'd also like to recommend using a proper strong-typed model to store the json (if that's feasible for you, of course) or, if you don't mind using up additional space, storing the original json string along with its bson counterpart (aka the easiest solution of all). 6. Let's see it: if you have this document: {. with support for type-safe query expression through F# quotations Nov 27, 2018 · I'm kind of new to LiteDB. This package relies on LiteDB 4. First example Aug 2, 2018 · Version: LiteDb 4. CollectionPage'. This get's exponentially slower with each consecutive insert. For example: LiteDBHelper. However, this is alright for my Getting Started. The GROUP BY clause restricts the possible values in this clause. var data = col. The version of LiteDB is 1. IndexOutOfRangeException: Index was outside the bounds of the array. New in-memory SortSet implementation mbdavid#805. ArgumentNullException' occurred in LiteDB. Calls update on all documents, /// then any documents not updated are then attempted to insert. What is happening is that C# is implicitly casting the id to Double when you insert and when you retrieve it, and apparently Double is losing precision at such magnitudes (just try Convert. Insert(T document) at ForGer. The code is the example code in getting started tutorial. dbTestItemHelper. Nov 3, 2018 · I do believe the Bson has some large overhead, my SQLite database with roughly the same amount of entries is only 1. Dec 18, 2017 · Bom dia Marcelo, vou aproveitar que teus comentários nos fontes estão em portugues e vou responder em portugues mesmo, facilita pra ambos ;) Entendi teu problema, a serialização (transformação da tua classe para BsonDocument) é feita a partir do mapeamento (classe BsonMapper) que contem as regras de como serializar. 0. NET document database. Collections. // you can do what you want with this ILiteCollection Nov 24, 2017 · LiteDB still just a database, not an ORM. Where(x => x. ToObject(Type type, BsonDocument doc) in LiteDB. When I stop the flow during debugging I see database-log file being generated but it disappears after the insert operation. // raw collection subscription // this subscription will NOT retrieve the list of items each time, but a ILiteCollection<Item> instead. Step 4: Try add, get, remove operations with a memory database. INSERT INTO {collection} [: {autoIdType}] VALUES {doc0} [, {docN}] collection is the name of the collection where the documents will be inserted. NET 3. If the file exists, it will open else it will create a new one. MoveNext() em LiteDBTestConsole. We are excited to see where this project goes and are looking forward to working with the community to make LiteDB the best it Dec 11, 2020 · Version Which LiteDB version/OS/. Feb 18, 2020 · But I found a minor bug in LiteDB when testing your example: DropCollection are not removing start index page when has no documents inside collection. For this purpose, LiteDB has the EXPLAIN command. LINQ expressions (lambda functions) can be used to create fluent API query in your C# code. In LiteDb Studio: The problem: The time is different with different timezone I set, If i am in tokyo, the time is +9, if i am in HK time is +8. Studio Public. ImageMagicInfoString Provide its collection name if the subcollection is using custom collection name. LiteDB: default - 5000 records ===== Insert : 4999 ms - 1000 records/second Bulk : 236 ms - 21184 records/second Update : 3674 ms - 1361 records/second CreateIndex : 176 ms - 28321 records/second Query : 204 ms - 24467 records/second Delete : 157 ms - 31722 records/second Drop : 17 ms - 289513 records/second FileLength : 7580 kb LiteDB: encrypted - 5000 records ===== Insert : 5690 ms - 879 Feb 9, 2018 · My goal with LiteDB v5 is a more useful database not only for small solutions or embedded database. LiteDB is a serverless database, so there is no installation. Unity). 5 Mojave. ToObject(Type type, BsonDocument doc) em LiteDB. All CRUD operations are included. Now I need to get the most recently added record so I can pull a value from it and increment it in a pattern. b52b06f. Jan 21, 2019 · but if you find a way to get your litedb better that i already is ;) The text was updated successfully, but these errors were encountered: All reactions 5. _id: 1, Aug 26, 2020 · Which LiteDB version/OS/. E. Studio admin tool. In this article we will have a closer look at LiteDB, a . Of course, my application doesn't store a really large amount of data, so it's not critically important. GetCollection("MyCollection"); how can i assign to each item's value INSERT. It makes sense for LiteDB to not allow nullable Id's. Mar 14, 2017 · Here's my scenario, I need to insert around 6 million records from a flat json file into LiteDB. 2). Exception Message: 参 Hi @softwareguy74, there is no composite primary key in LiteDB (not only pk, but any other index support for multiple keys). Got most things working. CreateInstance(Type type) em LiteDB. With server mode, LiteDB could be access datafiles using HTTP protocol in other languages (like web client app in javascript). We are now working on more frequent releases, better stability and performance, and better communication with the community. My goal is NOT ONLY the requested entity but also referenced ones. In _chuncks collection (in FileStorage) I used a string concatenation with FileId and SequenceNumber (like "myphoto/00001"). Avalonia Jan 27, 2016 · exception caused by insert operation. But, in v4 you can use expression in index, so you can combine 2 field in a single BsonDocument and create an unique index on it. Jul 14, 2022 · LiteDB supports indexes. 0 Support for v5 is work in progress and might require a full rewrite. 0 in a single DLL (less than 450kb) Thread-safe. <indexed_columns>>. Using the existing 26mb table I just made a simple Insert call with a new Company entity, Usually is able to insert in about 0. dll and upgraded later doesn't seem to be in management of version 4. Try using LiteDB. op_Implicit(BsonValue value) at App1. '. LiteDB is a document database, so there is no JOIN between collections. 30319). Using LiteDB, if your document (value) are over than 1Mb you must use FileStorage. Create a new folder inside of your models folder and name it Repos (short for repositories), inside of that folder create a new file named BlogRepo. InvalidProgramException: Invalid IL code in (wrapper dynamic-m It no longer works, it throws an System. A select expression can be: A literal of any BSON type that LiteDB supports; A valid JSON path; A function over literals or JSON paths. (REQUIRED) LITEDB version:5. even if you leave it there, the batches should be highly unpredictable. 4. from two different clients), I thought the file locking mechanism in LiteDB, and the fact that I'm using a new instance of LiteDatabase on every insert, would ensure that concurrent inserts would always work. Transaction[T](String collection, Boolean addIfNotExists, Func`2 action) at LiteDB. get rid of transaction. GetCollection<Player>("Player"); col. FileDiskService. 4) was inserting a record without setting the value of the Id field into a specific document collection started failing. That's why command mode are so important in this case. This also helps with concurrency, as you would create a child context for every thread to ensure separation as well access from only 1 thread. Author. In you case, the problem is image. e492fad. 000 string. First of all we need to get reference of specified collection. Nov 19, 2015 · Hi @dsoronda, LiteDB auto create index when you run query in a non indexed field. 5 / . . DeserializeObject(Type type, Object obj, BsonDocument value) in LiteDB. Try drop this index and insert again. A cross-platform tool for viewing and editing documents for LiteDB v5 powered by Prism. 18 or 5. LiteDB is a small, fast and lightweight . Code to Reproduce Example: create BsonExpression predicate with an argument; use it with DeleteMany, the expected document is not deleted; the same predicate works fine with FindOne You signed in with another tab or window. If you want store schemeless structure using Dictionary, you need some like this: public class Entity. Nov 30, 2019 · Setting up LiteDB. If you need search this field again, try use Linq using collection. Reload to refresh your session. i. Oct 3, 2018 · I believe for our users it sometimes happens when they are writing something to the liteDB and the application crashes. 3 / NETStandard 2. github-actions bot pushed a commit to Reddevildragg-UPM-Forks/LiteDB that referenced this issue on Nov 18, 2020. Program. NET NoSQL Document Store in a single data file - Issues · mbdavid/LiteDB. Generic; using static LiteDB. Documents are a schema-less data structure. ToObject[T](BsonDocument doc) 48 lines (41 loc) · 1. Hi @Roderik11, can you create a git repository with a Unity project with a simple example? BTW, I'm thinking to remove . CadastraTodosAsync(CommandContext ctx) in C:\Users\Nathan Ferreira\Desktop\ForGer\ForGer\Modules\DeveloperModule. 1. 3/2. The question is why? When I've looked into my_db_file. EQ("quescode[*]. When a process want read only data, open/create this file in FileShare. ToDouble(528233622268805130). 1, net45, Windows 10. Describe the bug Predicates with arguments do not work with collection's DeleteMany in LiteDB v5. cs:line 48 Firstly, we have to open a data file by creating an instance of LiteEngine with the specific path where the LiteDB is stored. Exception: LiteDB ENSURE: empty page must be defined as empty Aug 6, 2016 · Source=LiteDB StackTrace: em LiteDB. thank you! Getting Started. Forms v5. mbdavid / LiteDB. Full error: Exception has occurred: CLR/System. Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Deleting this row "revived" the db, and it started Aug 24, 2017 · Hi, I'm changing my Project to use LiteDB instead of Mongo and have this code to save player data: using (var db = new LiteDatabase(@"C:\MyData. Aug 10, 2018 · LiteDB will read you stream from current position to end. Main(String[] args) Oct 18, 2016 · I suggest to extend "DbRef for cross references" section on main page and add there more complex example of several levels of referencing such that people might have immediate idea how to do it. Serverless NoSQL Document Store; Simple API, similar to MongoDB; 100% C# code for . This could be happend to you. 8 NET FRAMEWORK:4. 10 . ctor(String filename, FileOptions options) This is a API that uses LiteDB as database. It also starts a background thread which all actions are performed in. You Apr 2, 2024 · When I upgraded to 5. CollectionService. Aug 30, 2016 · get rid of SSD. NET framework version are you using. LiteException: 'Cannot insert duplicate key in unique index '_id'. LiteDB is 100% managed . collection("framework"); now, framework variable refer to framework collection and similar for other collection every variable will refer to their own collection instance. The problem is datafile contains an unsed page. Deserialize(Type type, BsonValue value) in LiteDB. ToString("N0") and you'll see it becomes 528233622268805120). First off, fantastic work on this project, very impressive. New(Customer inItem, LiteRepository inLt) at App1. Is there any way to get only specific Qcode from the embedded document with user detail from parent doc like. We will also explore what are the differences between a NoSQL and a classical SQL database are and Jul 24, 2019 · When I create the data, I get a test. help Use-LiteDatabase - Full. Read mode and release/delete this file when finish. BsonMapper. 1 Xamarin. For more info, chech the GROUP BY documentation below. @kuiperzone, I has reading about other solutions to process safe and had an idea: use an -lock aditional file to control concurrency. Serverless NoSQL Document Store; Simple API similar to MongoDB; 100% C# code for . 9/Windows 10/. 0 in a single DLL (less than 300kb) Nov 28, 2019 · The option to display them as UTC or convert them to local time upon retrieval is now a pragma, which means it is stored in the header of the datafile and no longer defined in the connection string. LiteDB. for example if i have a record like. A collection is a group of related documents that have a set of shared indices. Find(LiteDB. To implement this, LiteDB must track objects to detect changes (insert/update/deletes). ToObject[T](BsonDocument doc) em LiteDB. Shell to check using db. Insert(String collection, BsonDocument doc, BsonType autoId) at LiteDB. mbdavid closed this as completed on Jul 9, 2016. 0 / NETStandard 1. Deserialize(Type type, BsonValue value) em LiteDB. DbRef. You can insert, update, delete or query your database using a very similar SQL relational language. LiteDB is a small, fast and lightweight NoSQL embedded database. Finally, IncludeAll () The class LiteDBHelper defines an extension method for Data Structure. (REQUIRED) LiteDB: 5. Just copy LiteDB. I don't really understand how this is an issue. {. Net. Save that read first stream (your image) to create a thumbnail. Dec 14, 2017 · I'd like to stress that regular expressions aren't the best in terms of performance and make the code less human-friendly. NET NoSQL Document Store in a single data file - mbdavid/LiteDB Aug 7, 2020 · @goldminer127 LiteDB does not natively suport UInt64, but it supports Int64 and Double. Oct 2, 2017 · mbdavid commented on Oct 3, 2017. The following structure defines the SQL insert syntax in LiteDB. Oct 27, 2019 · After investigating the causes of insert and update failures on old computers and old hard drives, if there are too many entries in the litedb document (more than 5 KB), and this document fails. public record Item(ObjectId Id, int Value); and a collection that contains many of these. 8. Insert(player); } This saves some d The situation I encountered today with LiteDB (version 4. FSharp provides serialization utilities making it possible for LiteDB to understand F# types such as records, unions, maps etc. 0 in a single DLL (less than 450kb) Insert (newItem); // receivedItems: [ newItem ] // receivedItem: newItem} If you change the collection quickly, and you want to throttle the notifications. All SQL commands are supported in new LiteDB. You can use some like that too. LiteDB - A . Step 3: Take a look at help and available commands: help about_Ldbc. Sep 26, 2017 · mbdavid commented on Nov 3, 2017. I am struggling with using Queries and Expressions to find the MAX _id item in the collection. ArgumentNullException. Materials, "materials"); _Note: The Register statement creates the DbRef for you in the global BsonMapper. Insert(String collection, BsonDocument doc, BsonType autoId) at Mar 24, 2017 · at LiteDB. Either you supply an Id which will be used, or you do not, in which case the Id will default to 0 and LiteDB will use auto-increment to create an Id for the entry. Find(. db") {. Was the problem due to the improper use of litedb?Or other reasons?what should I do ? Please forgive me for my poor English expression. db , inside it's 2014-01-01 07:00:00. Jun 3, 2020 · LiteDb version : v5. INSERT syntax? #30. GetCollectionPage(String name, Boolean addIfNotExits) at LiteDB. LiteDB supports SQL-like language for data and structure manipulations. NET Standard 2. Register<Recipe, MaterialInRecipe>(r => r. Problem: Sometimes I have caught exceptions like these: System. litedb. Jan 3, 2017 · mbdavid commented on Jan 4, 2017. You can use embedded documents (sub-documents) or create a reference between collections. your-collection. Merge #159 - fix #178 #186. This transaction is cancelled due to an aborted transaction In you example it's not that easy to query. Feb 15, 2017 · mbdavid commented on Feb 17, 2017. Next, I can read directly from disc, convert into a BsonDocument and insert the records at 1000 entries per BsonDocument array. public int Id { get; set; } public Dictionary<string, object> Data { get; set; } = new Dictionary<string, object>(); } The LiteDB team is excited to announce that we have added two new maintainers to the project. I recently had an issue, where liteDB had last item with index 5524, and was giving exception on same insert, that item 5524 already exists (well yes, yes it does indeed). litedb is only 8KB, whereas the test-log. This final version will run only in v4 and NetStandard 2. at LiteDB. DeveloperModule. using System; using System. LiteDB is a simple, fast and lightweight embedded . Today I found LiteDB and took some very basic tests: I've used the Basic example from www. The exception is thrown at "col. Nov 5, 2015 · If calls to the webserver overlap (e. Add(String name) at LiteDB. Read access are optimized to re-use cached block pages, so disk access are reduced too. LiteDB has "Include" option (which is called before Feb 25, 2020 · Version 5. There is quick tutorial section "DbRef for cross references" on LiteDB webpage how one can realize it. 2012 Describe the bug The database seems to get corrupted when I insert data. 14 >= version > 5. MainPage. ' on uinCollection. mbdavid commented on Dec 8, 2016. Oct 20, 2022 · LiteDB - A . An unhandled exception of type 'System. LiteException: Datafile is not a LiteDB database. ' with the following code? It looks like the AutoId doesn't work in this scenario, or am i missing something? publ The SELECT clause defines the projections that are applied to the results. This method Save run over your memory stream (to save the bytes) and do not get back to first position (to be saved on litedb). Nobody is going to get an SSD just for using LiteDB. I think this feature can be implemented in repository pattern layer. Checkpoint() method causes a deadlock. litedb is 3,976KB (or larger, depending on how many documents I insert) LiteDB is a small, fast and lightweight . 14. 9 KB. The duplicate value is '0'. The program reads a Northwind SQLite database and created and write the database tables and columns into a LiteDB database called FileOne. Or, you can create another key object like: public class MyKey {. Data recovery after write failure (WAL log file) Aug 19, 2020 · Insert operation needs to be runned immediately after the delete operation as in the example on a brand new database. Each document stores both its data and its structure. When a function that causes an evaluation is called it sends a message to the background thread, where the required action is performed by the LiteDb instance. 5 / NETStandard 1. (a) using Add-LiteData, Get-LiteData, Remove-LiteData: Feb 20, 2024 · This command will copy the data from the log file to its respective position in the data file (. dll. Hi @dburner, as I mention, there is no compound index in LiteDB, so you can compose an index with more than one field. Insert(),calling LiteDatabase. Merge mbdavid#159 - fix mbdavid#178 mbdavid#186. First of all, we need to understand whether this query uses some kind of index or not. Next, using LiteEngine instance and get a typed collection of issues. We will discover the advantages of LiteDB and why it is a viable candidate for your next project. Code to Reproduce I have created and attached a small program to reproduce the issue. 4 fetched by nuget, and the framework is 4. Modules. But you will have same problems with this option: you will need serialize your class by your own, insert/update/delete are made in chuncks (no transaction). Make a call to “Insert” method with the issue entity to create a new document in Second, Software shouldn't act against common sense and usual rules, and so X (And) Y should equal the statement Y (And) X. With this you are only running the WASM head). dll into your Bin folder and add it as Reference. 5 Describe the bug Affter called ILiteCollection. Insert(). F# Support for LiteDB. 2 OS:win 7. However, it is very easy to reproduce an exception: Cannot insert duplicate key in unique index I want to get all the users containing specific QCode (ex: q104). Data recovery after write failure (WAL log file) Oct 18, 2016 · LiteDB stores the cross-referenced entities perfectly fine, but problem comes when I am trying to find/load entities back. ILiteCollection<Item> collection = db. You can set the UTC_DATE pragma to true with the following command: using (var db = new LiteDatabase ("data. Dec 14, 2016 · I'm getting exception when I try LiteDB on Unity3d (5. Simple API, similar to MongoDB. The type to be serialized is System. Feb 5, 2020 · LiteDB 5. Reflection. LiteException: Invalid format: Channel`1 at LiteDB. INSERT INTO {collection} [: {autoIdType}] …. ghost commented on Aug 10, 2018. : Feb 21, 2018 · in LiteDB. 👍 1. 15~ seconds. I'm fixing and pushing soon. LiteEngine. If you are running in a web environment, make sure that your IIS user has write permission to the data folder. IPEndPoint. NET 4. Version Which LiteDB version/OS/. Feb 13, 2020 · You signed in with another tab or window. INSERT INTO {collection}[: {autoIdType}] VALUES {doc0} [, {docN}] collection is the name of the collection where the documents will be inserted. I can create a POCO, make a db connection and do a collection. Insert (user); Either v3 or v4, it doesn't work with the latter set up. LiteDatabase. db on the desktop. Checkpoint(). LiteCollection1. Code to Reproduce Apr 22, 2022 · Tell me, can I somehow save data using Insert array and Include in one operation? Or should I use foreach to first write the NamesModel in "names" DB, get the generated _id, then write the ItemsModel with a link to the NamesModel already written to the database? Nov 4, 2018 · How come that i get a LiteDB. 2. HeaderPage' to type 'LiteDB. There is an offset between Insert and Retrieve . Let's open up the file and create a new repo Dec 12, 2016 · I tried this scenario with LiteDB but I am getting random exceptions in different part of the code. All classes are converted to BSON (binary json) and (in your example) if collection if of Vehicle and you insert an object that is not a Vehicle (but is a subclass of) a _type attribute will be saved. NET embedded NoSQL database. However, it would be great to use indexes and execute queries as fast as possible. 5 support in final release of LiteDB v4. a batch of 1 record, then a batch of 10 records, then a batch of 2 records, then a batch of 1 record. Keyworks are case-insensitive. mbdavid added a commit that referenced this issue on Jul 9, 2016. MainPage_Loaded(Object sender, RoutedEventArgs e) Type Customer is from your example code; In fact the Insert does work, I can see the data in the db file (as json format:) Nov 16, 2022 · To create a new app you can simply type: dotnet new unoapp-uwp-net6 -o LiteDBSample (the template allows also for optionally removing some Uno Platform heads: dotnet new unoapp-uwp-net6 -o LiteDBSample -M=false -skia-wpf=false -skia-gtk=false -skia-linux-fb=false. Insert(customer);" line. 5. Agora, vamos fazer um requisição POST para inserir uma informação em nosso banco de dados: Após a requisição POST, vamos verificar, através da requisição GET se a informação foi, realmente, inserida Oct 1, 2019 · I think i found one of the reasons for the error: LiteDB. Here are multiple examples: System. 0(v4. The code path for this insert hadn't changed in over 5 months, but inserting into one specific Collection in the LiteDB database stopped working earlier today. LiteDB was inspired by the MongoDB database and its API is very …. db")) { var col = db. ACID with full transaction support. g. The text was updated successfully, but these errors were encountered: Owner. Remove the predictability, toss the yield keyword out of the window. LiteDB stores documents in collections. Nov 29, 2017 · The old datas's id in database file which made by version 2. Oct 16, 2018 · at LiteDB. As i saw on other issues referecing this problem, is the database file that become kinda corrupt, but only when the system tryes to read, on the studio everything goes fine. litedb file (which is the nominated filename) and a test-log. Engine { public partial class LiteEngine { /// <summary> /// Implement upsert command to documents in a collection. 5mb and the table has quite a few properties as well. 19 is when the bug occurred. AddNode(CollectionIndex index, BsonValue key, IndexNode last) в LiteDB Feb 15, 2020 · I tell LiteDB that the collection is auto id Int32; I insert documents with _id = 0 (the fact that the collection is untyped does not matter) LiteDB should generate new _id, it has all the required information for doing this; this way is consistent with what LiteDB does in typed cases; This looks natural. indexes. And now we going to insert own first document to our collection, therefor we also need Nov 2, 2023 · Same for me, I'm tying to find out a way to update one field of a record with a new value using the UpdateMany. LiteDB stores data as documents, which are JSON-like objects containing key-value pairs. . e. Step 2: In a PowerShell command prompt import the module: Import-Module Ldbc. NET NoSQL embedded database. You signed out in another tab or window. LiteCollection`1. NET code, runs in-process. I don't think it makes sense for LiteDB to implement sql semantics and shouldn't depend on ORM because it's NoSql. The exceptions are as follows and they are appearing randomly: Invalid transaction on top of stack; Unable to cast object of type 'LiteDB. NET NoSQL Document Store in a single data file. IndexService. Query. NET 6 and 8 (Happens in both) Describe the bug Here I insert multiple entities using InsertBulk in a loop. The developer can make a bunch of changes to it (insert, update, delete) then decide to commit it to a parent context (or a persistent store/file) or scrap all the changes. You cannot use Dictionary as base class in collection. You switched accounts on another tab or window. - joao2391/LiteDB_API_Example The constructor LiteDatabaseAsync opens and wraps a LiteDB instant. The bug occurred when an insert followed Feb 17, 2021 · Version LiteDB v5. Get-Command - Module Ldbc. It's possible, but you must remember that LiteDB is a document database, not a object database. AddNode(CollectionIndex index, BsonValue key, Byte level, IndexNode last) в LiteDB. 18 Windows 10 . d__34. But, before this, I will create a fork project exclusive to work in Unity (LiteDB. autoIdType is one of the supported auto id types supported ( GUID, INT, LONG, OBJECTID ). NET framework 4. OSX 10. If your stream already at end, there is nothing to read. BsonValue. or in an EF implementation. db). Qcode", "q104" )); This returns complete documents of the users with all the Qcodes. test. 100% C# code for . INSERT. This class will serve as the default repository, in it we'll store all of our posts for now and maybe some more collections later. Serverless NoSQL Document Store. const framework = LiteDB. Avalonia - SuessLabs/LiteDB. Another way is change document size const in your forked version. 0/Windows 7/. Describe the bug If I delete non existing collection using "DeleteMany" function ,then I can not insert data into database successfully using "Upsert" Method,but "Upsert" Method returns true. dll: 'Value cannot be null. NET Framework 4. To create a reference you can use [BsonRef] attribute or use the DbRef method from the fluent API mapper. Describe the bug Complex queries on nested documents only ever return first result set, even after subsequent queries with different criteria. 0 litedb. cs. NullReferenceException: 'Object reference not set to an instance of an object. What’s not been updated in a month: . uw mo uf jm xw ah gq ny lx kt