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
1
vote
1 answer

LiteDB insert or retrieve master's details List

How can we insert or retrieve master's details from the below represented Detail property using LiteDB (LiteDatabase) C#.net library? class myEntityMaster{ public int ID {get;set;} public string Name {get;set;} public…
garry man
  • 445
  • 4
  • 14
1
vote
2 answers

LiteDB- How to add 2 DLL of LiteDB in two different project but they are referenced by one Main project

I have created 3 projects: V_1_OperationProject: (Class library project)To handle operation on LiteDb version 1 V_4_OperationProject : (Class library project)To handle operation on LiteDb version 4 MainProject: Gives the calls to methods in…
Smiley
  • 55
  • 4
1
vote
2 answers

How to display LiteDB data in DataGridView?

I am new to LiteDB, however it seems perfect for my application after using a cumbersome CSV file, but I am having trouble displaying the data in a Windows Form DataGridView. My LiteDB database is working fine with storing data but need help…
Moms
  • 175
  • 14
1
vote
1 answer

LiteDb Where Query

I have setup LiteDb with following models. public partial class User { [JsonProperty("id")] public long Id { get; set; } [JsonProperty("email")] public string Email { get; set; } [JsonProperty("name")] public string Name {…
gv1507
  • 47
  • 4
  • 10
1
vote
1 answer

Is there an equivalent of Vacuum command of SQLite in LiteDB?

Is there an equivalent of Vacuum command of SQLite in LiteDB? The VACUUM command rebuilds the database file, repacking it into a minimal amount of disk space.
user8803505
  • 126
  • 1
  • 5
1
vote
2 answers

Upsert is not functioning in LiteDB

I am trying to do something like this : db = new LiteDatabase(@"albumdata.db"); db_string = db.GetCollection("strings"); db.Engine.EnsureIndex("strings", "a", true); db_string.Upsert(new StringPair("a", "1")); // this line throws this…
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210
1
vote
1 answer

LiteDB Multiple Column/Field ID

I have a class that has multiple fields. Lets say for example: class MyClass { public int x {get; set;} public int y {get; set;} public int z {get; set;} } I want to use LiteDB with that class, and have it use both x and y as a key. So…
Ungoliant
  • 133
  • 2
  • 14
1
vote
2 answers

Use "where in" for LiteDB

I enjoy working with LiteDB in Xamarin.Forms. What is the best practice for getting list of objects from a table using list of ids or indexes in condition? Currently, it looks for me like this: _db.GetCollection().FindAll().Where(q =>…
Serg
  • 95
  • 8
1
vote
1 answer

Rename object, or change it's primary key (_id) value

I'm implementing the UPDATE part of a CRUD interface, and using LiteDB to store my collection of objects. The objects I am storing are Schedules and Schedule.ScheduleName is the index on the collection. Schedule.ScheduleName is the [BsonId] of the…
Dave
  • 1,521
  • 17
  • 31
1
vote
2 answers

LiteDb - File Storage searching

I am looking at using LiteDb for C# as a document storage system. I can upload and download so long as I know the ID of the file - but I want to have the option to search for it as well. LiteDb documentation gives this command for searching all the…
Adrian Brown
  • 73
  • 1
  • 9
1
vote
2 answers

LiteDB multiple queries in C#

I am new to LiteDB and would like to execute two or more queries in one go. I want to be able to search for a certain customer in my DataBase and since there will be multiple customers with a similar name I want return all of them and sort them in…
McBooley
  • 433
  • 1
  • 5
  • 16
1
vote
1 answer

Impossible to save collection of strings to LiteDb

I am trying to save collection of the strings to LiteDb using (var db = new LiteDatabase(@"MyData.db")) { var col = db.GetCollection("Writers"); col.Insert("Mark Twain"); col.Insert("Jack London"); } It throws "Object reference…
Just Me
  • 41
  • 1
  • 8
1
vote
2 answers

Xamarin LiteDB UnauthorisedAccessException

I'm trying to use LiteDB within a Xamarin Forms application, however I can't seem to gain access to write or read from the file. Called from my MainViewModel.cs I've added the permissions to AndroidManifest.xml;
wonea
  • 4,783
  • 17
  • 86
  • 139
1
vote
1 answer

How to Join In LiteDb

How can i join between two table in LiteDb Like SQL Example : I Have Two table User and ActivityLog Here is the Model public class ActivityLog { [BsonId] public int Id { get; set; } public string UserId { get; set; } public string…
Mehaboob
  • 121
  • 2
  • 12
1
vote
1 answer

Creating a LiteDb database with a StorageFile argument

I am trying to implement a database provider using LiteDb on my raspberry pi using UWP. It has an external hard drive attached and I would very much like to use it as a specific "Database" drive, to allow me to have a larger supported database…
Chris Watts
  • 822
  • 1
  • 9
  • 27