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

Arbitrary/string return value from LiteDb query

I have a LiteDb database on which I would like the user to be able to run arbitrary queries (given as a string; assume that we demand their query also always returns a string). Unfortunately I seem to be locked into always receiving the type given…
Patrick
  • 677
  • 5
  • 14
0
votes
1 answer

How to prevent space being removed from the field while updating the lite DB record

I am using lite DB for my WPF application. I am using the following function to update the record in lite DB. public void Update(T data) { (DBInstance as LiteDBInstance).LiteDatabase.GetCollection(TableName).Update(data); } The…
Praveen
  • 47
  • 8
0
votes
1 answer

How to convert string to LiteDb.ObjectId and vise versa in c#

public class TaskModel { [BsonId] public ObjectId Id { get; set; } public string Name { get; set; } } public class TaskViewModel { public string Id { get; set; } public string Name { get; set; } } public class AutoMapperProfile :…
0
votes
1 answer

Custom serializers and deserializers in LiteDB v5.0.9

The release notes for LiteDB 5.0.9 says, "Custom serializers and deserializers can now be used even with basic BSON types. This is useful if you don't want to lose precision when storing DateTime." But there doesn't appear to be any documentation…
0
votes
1 answer

Simple LiteDB query via C# (I'm struggling!)

So, I thought I'd give LiteDB a try, but I'm struggling a bit! Trying to write log data to it. So, what I have so far (simplified) A class (the data strinture) private class PerBarData { public DateTime ts { get; set; } public double o {…
user946207
  • 11
  • 3
0
votes
1 answer

LiteDb class deserialization is not working

I have B class that has a class A as member. The LiteDb store it correctly as I see in LiteDB Studio. "As" collection is also OK. Why is it not right in the deserialization? Class A has a BsonCtor. B also namespace ConsoleAppTestDeserializatioBug { …
swWork
  • 53
  • 4
0
votes
1 answer

When shrink litedb files then app cannot find index on ._id. How could i fix it?

I use 3.xx version of litedb and want to shrink the file since it always grows its size. I shrunk it using LiteDbExplorer's "shrink" button, but now app cannot use this db file. But still it seems good when using viewer litedbexplorer, litedbviewer,…
K.S
  • 13
  • 3
0
votes
1 answer

How to store other language in LiteDB?

I am making a quiz game with C# in which I wanna store Korean as question . I'm not sure that It is storing Korean but when I fetch data then it show like ??? instead of Korean characters , so what I can do to show or use Korean character in my…
0
votes
0 answers

Combine queries on the same table in LiteDB

I am using LiteDB, and trying to improve performance. I currently have two queries on the same table, and was wondering if there is another way to combine these two queries as one to improve performance. using (var db = new…
heather
  • 21
  • 3
0
votes
1 answer

Unable to store and retrieve data from LiteDb

I am trying to write one object to LiteDb and read it back. I have tried following code but somehow all parameters of LiteDbParamEntry object are returned as NULL or zero. public class LiteDbParamEntry { [BsonId] public int Id { …
Kamalesh Wankhede
  • 1,475
  • 16
  • 37
0
votes
1 answer

LiteDB query on list

I am having issues being able to figure out how to query a list inside an object effectively. I have the following classes: public class IdentitySubstitutionModel { public Guid Id { get; set; } public List
heather
  • 21
  • 3
0
votes
0 answers

Getting SIGSEGV while reading data from Litedb collection simultaneously in multiple threads

I am using Litedb v4 in Xamarin, I am creating liteDatabase connection and getting collections inside it once, and passing the collection to multiple threads which perform givenCollection.findALL().ToList() simultaneously. The app crashes…
sanjiv saini
  • 356
  • 1
  • 3
  • 11
0
votes
1 answer

Unable to cast object of type "custom type" to type 'System.Collections.IEnumerable' Using LiteDB

Getting a System.InvalidCastException when trying to save custom classes into a LiteDB collection. The line of code where the error is thrown: using (var db = new LiteDatabase(_datastore)) { var results =…
MBT86
  • 51
  • 4
0
votes
1 answer

LiteDB - find data object via List.contains

A simplified version. I have two classes: Public Class mSystem Public Property ID as ObjectID Public Property Name as string End Class Public Class mEmulator Public Property ID as ObjectID Public Property Name as string …
stigzler
  • 793
  • 2
  • 12
  • 29
0
votes
1 answer

Xamarin forms LiteDB - Real android device problem

Using LiteDB with Xamarim forms, creating a database using this: var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); var dirPath = Path.Combine(documentsPath, "MyDB.db"); Debugging in an Android emulator, works…