{"id":26400192,"url":"https://github.com/mbdavid/LiteDB","last_synced_at":"2025-03-17T14:01:18.447Z","repository":{"id":20046890,"uuid":"23315232","full_name":"litedb-org/LiteDB","owner":"litedb-org","description":"LiteDB - A .NET NoSQL Document Store in a single data file","archived":false,"fork":false,"pushed_at":"2024-12-10T14:07:23.000Z","size":46011,"stargazers_count":8815,"open_issues_count":732,"forks_count":1266,"subscribers_count":291,"default_branch":"master","last_synced_at":"2025-03-14T16:03:43.056Z","etag":null,"topics":["database","dotnet","litedb","nosql"],"latest_commit_sha":null,"homepage":"http://www.litedb.org","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litedb-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-25T13:49:30.000Z","updated_at":"2025-03-14T15:59:10.000Z","dependencies_parsed_at":"2023-02-14T09:02:23.701Z","dependency_job_id":"8320e104-1ab5-4980-8fca-f02473f2ad1c","html_url":"https://github.com/litedb-org/LiteDB","commit_stats":null,"previous_names":["litedb-org/litedb","mbdavid/litedb"],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litedb-org%2FLiteDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litedb-org%2FLiteDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litedb-org%2FLiteDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litedb-org%2FLiteDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litedb-org","download_url":"https://codeload.github.com/litedb-org/LiteDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047608,"owners_count":20389205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","dotnet","litedb","nosql"],"created_at":"2025-03-17T14:00:54.924Z","updated_at":"2025-03-17T14:01:18.432Z","avatar_url":"https://github.com/litedb-org.png","language":"C#","readme":"# LiteDB - A .NET NoSQL Document Store in a single data file\n\n[![NuGet Version](https://img.shields.io/nuget/v/LiteDB)](https://www.nuget.org/packages/LiteDB/)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/LiteDB)](https://www.nuget.org/packages/LiteDB/)\n[![Build status](https://ci.appveyor.com/api/projects/status/sfe8he0vik18m033?svg=true)](https://ci.appveyor.com/project/mbdavid/litedb) \n[![](https://dcbadge.limes.pink/api/server/u8seFBH9Zu?style=flat-square)](https://discord.gg/u8seFBH9Zu)\n\n\nLiteDB is a small, fast and lightweight .NET NoSQL embedded database. \n\n- Serverless NoSQL Document Store\n- Simple API, similar to MongoDB\n- 100% C# code for .NET 4.5 / NETStandard 1.3/2.0 in a single DLL (less than 450kb)\n- Thread-safe\n- ACID with full transaction support\n- Data recovery after write failure (WAL log file)\n- Datafile encryption using DES (AES) cryptography\n- Map your POCO classes to `BsonDocument` using attributes or fluent mapper API\n- Store files and stream data (like GridFS in MongoDB)\n- Single data file storage (like SQLite)\n- Index document fields for fast search\n- LINQ support for queries\n- SQL-Like commands to access/transform data\n- [LiteDB Studio](https://github.com/mbdavid/LiteDB.Studio) - Nice UI for data access \n- Open source and free for everyone - including commercial use\n- Install from NuGet: `Install-Package LiteDB`\n\n\n## New v5\n\n- New storage engine\n- No locks for `read` operations (multiple readers)\n- `Write` locks per collection (multiple writers)\n- Internal/System collections \n- New `SQL-Like Syntax`\n- New query engine (support projection, sort, filter, query)\n- Partial document load (root level)\n- and much, much more!\n\n## Lite.Studio\n\nNew UI to manage and visualize your database:\n\n\n![LiteDB.Studio](https://www.litedb.org/images/banner.gif)\n\n## Documentation\n\nVisit [the Wiki](https://github.com/mbdavid/LiteDB/wiki) for full documentation. For simplified chinese version, [check here](https://github.com/lidanger/LiteDB.wiki_Translation_zh-cn).\n\n## LiteDB Community\n\nHelp LiteDB grow its user community by answering this [simple survey](https://docs.google.com/forms/d/e/1FAIpQLSc4cNG7wyLKXXcOLIt7Ea4TlXCG6s-51_EfHPu2p5WZ2dIx7A/viewform?usp=sf_link)\n\n## How to use LiteDB\n\nA quick example for storing and searching documents:\n\n```C#\n// Create your POCO class\npublic class Customer\n{\n    public int Id { get; set; }\n    public string Name { get; set; }\n    public int Age { get; set; }\n    public string[] Phones { get; set; }\n    public bool IsActive { get; set; }\n}\n\n// Open database (or create if doesn't exist)\nusing(var db = new LiteDatabase(@\"MyData.db\"))\n{\n    // Get customer collection\n    var col = db.GetCollection\u003cCustomer\u003e(\"customers\");\n\n    // Create your new customer instance\n    var customer = new Customer\n    { \n        Name = \"John Doe\", \n        Phones = new string[] { \"8000-0000\", \"9000-0000\" }, \n        Age = 39,\n        IsActive = true\n    };\n\n    // Create unique index in Name field\n    col.EnsureIndex(x =\u003e x.Name, true);\n\n    // Insert new customer document (Id will be auto-incremented)\n    col.Insert(customer);\n\n    // Update a document inside a collection\n    customer.Name = \"Joana Doe\";\n\n    col.Update(customer);\n\n    // Use LINQ to query documents (with no index)\n    var results = col.Find(x =\u003e x.Age \u003e 20);\n}\n```\n\nUsing fluent mapper and cross document reference for more complex data models\n\n```C#\n// DbRef to cross references\npublic class Order\n{\n    public ObjectId Id { get; set; }\n    public DateTime OrderDate { get; set; }\n    public Address ShippingAddress { get; set; }\n    public Customer Customer { get; set; }\n    public List\u003cProduct\u003e Products { get; set; }\n}        \n\n// Re-use mapper from global instance\nvar mapper = BsonMapper.Global;\n\n// \"Products\" and \"Customer\" are from other collections (not embedded document)\nmapper.Entity\u003cOrder\u003e()\n    .DbRef(x =\u003e x.Customer, \"customers\")   // 1 to 1/0 reference\n    .DbRef(x =\u003e x.Products, \"products\")    // 1 to Many reference\n    .Field(x =\u003e x.ShippingAddress, \"addr\"); // Embedded sub document\n            \nusing(var db = new LiteDatabase(\"MyOrderDatafile.db\"))\n{\n    var orders = db.GetCollection\u003cOrder\u003e(\"orders\");\n        \n    // When query Order, includes references\n    var query = orders\n        .Include(x =\u003e x.Customer)\n        .Include(x =\u003e x.Products) // 1 to many reference\n        .Find(x =\u003e x.OrderDate \u003c= DateTime.Now);\n\n    // Each instance of Order will load Customer/Products references\n    foreach(var order in query)\n    {\n        var name = order.Customer.Name;\n        ...\n    }\n}\n\n```\n\n## Where to use?\n\n- Desktop/local small applications\n- Application file format\n- Small web sites/applications\n- One database **per account/user** data store\n\n## Plugins\n\n- A GUI viewer tool: https://github.com/falahati/LiteDBViewer (v4)\n- A GUI editor tool: https://github.com/JosefNemec/LiteDbExplorer (v4)\n- Lucene.NET directory: https://github.com/sheryever/LiteDBDirectory\n- LINQPad support: https://github.com/adospace/litedbpad\n- F# Support: https://github.com/Zaid-Ajaj/LiteDB.FSharp (v4)\n- UltraLiteDB (for Unity or IOT): https://github.com/rejemy/UltraLiteDB\n- OneBella - cross platform (windows, macos, linux) GUI tool : https://github.com/namigop/OneBella\n- LiteDB.Migration: Framework that makes schema migrations easier: https://github.com/JKamsker/LiteDB.Migration/\n\n## Changelog\n\nChange details for each release are documented in the [release notes](https://github.com/mbdavid/LiteDB/releases).\n\n## Code Signing\n\nLiteDB is digitally signed courtesy of [SignPath](https://www.signpath.io)\n\n\u003ca href=\"https://www.signpath.io\"\u003e\n    \u003cimg src=\"https://about.signpath.io/assets/signpath-logo.svg\" width=\"150\"\u003e\n\u003c/a\u003e\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","funding_links":[],"categories":["Frameworks, Libraries and Tools","DataBase","C#","Database","C# #","Databases","框架, 库和工具","nosql","数据库"],"sub_categories":["Database","Database Drivers","NoSQL, Document Databases","数据库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbdavid%2FLiteDB","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbdavid%2FLiteDB","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbdavid%2FLiteDB/lists"}