Questions tagged [litedb]

Use this tag for questions about LiteDB, which is a a free, open-source, embedded NoSQL database for .NET available via nuget or direct download.

LiteDB is a free, open-source, embedded NoSQL database for .NET inspired by MongoDB. Because it is a serverless document store, LiteDB can be "installed" via NuGet or by copying a dll into your project's bin folder.

Resources

Related Tags

183 questions
0
votes
1 answer

Problem on using SELECT in LiteDB: only one item returned

I'm trying to use LiteDB in a Powershell application, no problem to create a table from a JSON file: $db = [LiteDB.LiteDatabase]::new("ITQuote.db") $Collection = $db.GetCollection("Quotes",[LiteDB.BsonAutoId]::Int64) $file =…
Rossati
  • 79
  • 1
  • 5
0
votes
0 answers

LiteDB reference multiple/different collections in the same property

tl;dr: Is it possible to reference multiple, different, collections in the same property? I have an interface: public interface IItem { public int Id { get; set; } public string FullName { get; set; } } And 2 classes that implement it: //…
jreed121
  • 2,067
  • 4
  • 34
  • 57
0
votes
0 answers

LiteDB 5 backup while application is running

We are using liteDB 5.0 in a desktop application that will run 24 hours a day, 7 days a week, 50 weeks a year. I wonder what is the best way to make a backup there. The simplest solution is to back up the database file, but it is open all the…
h.m.i.13
  • 353
  • 1
  • 6
  • 17
0
votes
1 answer

Keep LiteDB open for the entire program lifecycle?

For situations where a model or viewmodel retrieves needed data (different threads?), is it possible to make a singleton, open db on program start, keep it open the entire time, only closing on program termination? Can this be used in…
Daniel
  • 1,064
  • 2
  • 13
  • 30
0
votes
0 answers

Storing metadata in litedb database

I'm using separate litedb databases and want to add some additional information to each database. How to do that properly? I'm going to use special collection with one single object with metadata: internal class DBInfo { public int Id { get;…
Spark13
  • 146
  • 1
  • 10
0
votes
1 answer

LiteCollection to CSV

Apologies for the simplistic question - I'm just a hobbyist programmer. In C# How do I save the LiteCollection to a CSV file? I can see from the Documentation (https://www.litedb.org/docs/collections/) that there is a 'SELECT $ INTO…
JustAPleb
  • 309
  • 4
  • 18
0
votes
1 answer

Why I am getting Serialization and deserialization of 'System.Type' instances are not supported. Path: $.EntityMapper.ForType.?

I am new to LiteDatabase. I have the following db. using (var db = new LiteDatabase(@"MyData.db")) { var users = db.GetCollection("users"); return new JsonResult(users); } When I try convert users to json. var d =…
user123456
  • 2,524
  • 7
  • 30
  • 57
0
votes
0 answers

using LiteDB.dll v. 4.1.4.0 and 4.1.5.0 side by side

Hallo I've failed to bind both versions of a LiteDB library to my project. There's a necessity to consume both versions to access old and new databases from GUI though. Nothing, I've found on internet, functioned. The project took the newest one,…
homecoder
  • 1
  • 1
0
votes
0 answers

How can I write Query.All() equivalent in LiteDb 5 using a BsonExpression

In LiteDb 4 we used Query.All() when we want to go for less restrictive filter expression to more restrictive. Now, in LiteDb 5, we must use BsonExpression and Query.All() return a Query object. How can create a BsonExpression like…
0
votes
1 answer

LiteDb auto-increment id sub list of class

I have these classes and got issue with auto increase id of sub lists: class A { public int Id { get; set; } public string Value { get; set; } public List Bs { get; set; } } class B { public int Id { get; set; } public string…
0
votes
0 answers

Reading/Writing Dictionary in LiteDB

I currently have an issue writing/reading a particular object structure into and out of LiteDB. Using LiteDB 5.0.12 Below is an example of the object structure I am using with the majority of properties ommited as they're irrelevant. The Properties…
Daniel
  • 369
  • 1
  • 4
  • 19
0
votes
0 answers

Storing binary data in LiteDB

I am reading data from RabbitMq as binary data and trying to store it in the LiteDB. Does the LiteDB support storage of binary data or should I be converting them to Base64 encoded string and storing it?
0
votes
0 answers

Can't dispose of service because Data Annotation Validation interrupt further logic

I have a service that should perform persistent logic and is being used with dependency injection as Transient Every time this implementation is called it should read or create a database file, and LiteDB needs to perform disposal. public class…
0
votes
0 answers

How to handle class inheritance in LiteDB with custom IDs

I would like to persist a class which implements an interface and can have various subclasses. I am just trying to understand how LiteDB handles this setup. In particular I have a code structure like so: public interface IItem { string UniqueKey…
Simple Guy
  • 568
  • 5
  • 21
0
votes
0 answers

Any way to mimic JsonConverter style serializing/deserializing of complex objects with LiteDB?

I am running a spike moving multiple flat json file storage files over to use LiteDB where each file will become a collection. At the high level this all seems perfectly fine and should map over well, however when I get into the details of it I…
Grofit
  • 17,693
  • 24
  • 96
  • 176