• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

LiteDB: LiteDB - A .NET NoSQL Document Store in a single data file - www.litedb. ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

LiteDB

开源软件地址:

https://gitee.com/ajeelee/LiteDB

开源软件介绍:

LiteDB - A .NET NoSQL Document Store in a single data file

Join the chat at https://gitter.im/mbdavid/LiteDB Build status Build Status


LiteDB is a small, fast and lightweight .NET NoSQL embedded database.

  • Serverless NoSQL Document Store
  • Simple API, similar to MongoDB
  • 100% C# code for .NET 4.5 / NETStandard 1.3/2.0 in a single DLL (less than 450kb)
  • Thread-safe
  • ACID with full transaction support
  • Data recovery after write failure (WAL log file)
  • Datafile encryption using DES (AES) cryptography
  • Map your POCO classes to BsonDocument using attributes or fluent mapper API
  • Store files and stream data (like GridFS in MongoDB)
  • Single data file storage (like SQLite)
  • Index document fields for fast search
  • LINQ support for queries
  • SQL-Like commands to access/transform data
  • LiteDB Studio - Nice UI for data access
  • Open source and free for everyone - including commercial use
  • Install from NuGet: Install-Package LiteDB

New v5

  • New storage engine
  • No locks for read operations (multiple readers)
  • Write locks per collection (multiple writers)
  • Internal/System collections
  • New SQL-Like Syntax
  • New query engine (support projection, sort, filter, query)
  • Partial document load (root level)
  • and much, much more!

Lite.Studio

New UI to manage and visualize your database:

LiteDB.Studio

Documentation

Visit the Wiki for full documentation. For simplified chinese version, check here.

LiteDB Community

Help LiteDB grow its user community by answering this simple survey

How to use LiteDB

A quick example for storing and searching documents:

// Create your POCO classpublic class Customer{    public int Id { get; set; }    public string Name { get; set; }    public int Age { get; set; }    public string[] Phones { get; set; }    public bool IsActive { get; set; }}// Open database (or create if doesn't exist)using(var db = new LiteDatabase(@"MyData.db")){    // Get customer collection    var col = db.GetCollection<Customer>("customers");    // Create your new customer instance    var customer = new Customer    {         Name = "John Doe",         Phones = new string[] { "8000-0000", "9000-0000" },         Age = 39,        IsActive = true    };    // Create unique index in Name field    col.EnsureIndex(x => x.Name, true);    // Insert new customer document (Id will be auto-incremented)    col.Insert(customer);    // Update a document inside a collection    customer.Name = "Joana Doe";    col.Update(customer);    // Use LINQ to query documents (with no index)    var results = col.Find(x => x.Age > 20);}

Using fluent mapper and cross document reference for more complex data models

// DbRef to cross referencespublic class Order{    public ObjectId Id { get; set; }    public DateTime OrderDate { get; set; }    public Address ShippingAddress { get; set; }    public Customer Customer { get; set; }    public List<Product> Products { get; set; }}        // Re-use mapper from global instancevar mapper = BsonMapper.Global;// "Products" and "Customer" are from other collections (not embedded document)mapper.Entity<Order>()    .DbRef(x => x.Customer, "customers")   // 1 to 1/0 reference    .DbRef(x => x.Products, "products")    // 1 to Many reference    .Field(x => x.ShippingAddress, "addr"); // Embedded sub document            using(var db = new LiteDatabase("MyOrderDatafile.db")){    var orders = db.GetCollection<Order>("orders");            // When query Order, includes references    var query = orders        .Include(x => x.Customer)        .Include(x => x.Products) // 1 to many reference        .Find(x => x.OrderDate <= DateTime.Now);    // Each instance of Order will load Customer/Products references    foreach(var order in query)    {        var name = order.Customer.Name;        ...    }}

Where to use?

  • Desktop/local small applications
  • Application file format
  • Small web sites/applications
  • One database per account/user data store

Plugins

Changelog

Change details for each release are documented in the release notes.

Code Signing

LiteDB is digitally signed courtesy of SignPath

License

MIT


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
codefinger-dao: Java数据库访问工具发布时间:2022-03-24
下一篇:
goMontioringDdl: go 通过binlog实现监控ddl发送钉钉报警发布时间:2022-03-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap