Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:14
    arty1901 commented #1932
  • 09:27
    MichaelRumpler opened #1952
  • 09:27
    MichaelRumpler labeled #1952
  • 08:20
    loanburger edited #1951
  • 02:49
    loanburger opened #1951
  • 02:49
    loanburger labeled #1951
  • Mar 03 18:42
    fritz-net commented #1944
  • Mar 03 08:33
    losmac closed #1950
  • Mar 03 08:33
    losmac commented #1950
  • Mar 03 08:14
    losmac edited #1950
  • Mar 03 08:12
    losmac edited #1950
  • Mar 03 08:12
    losmac edited #1950
  • Mar 02 21:17
    losmac opened #1950
  • Mar 02 21:17
    losmac labeled #1950
  • Mar 02 17:49
    alb3ric edited #1949
  • Mar 02 17:48
    alb3ric opened #1949
  • Mar 02 17:48
    alb3ric labeled #1949
  • Mar 02 16:34
    Yanitrix commented #1481
  • Mar 02 06:36
    GW-FUB closed #1833
  • Mar 02 06:36
    GW-FUB commented #1833
Floowey
@Floowey
Hello, I'd like to ask what the return value of the rebuild() function is supposed to represent?
d8ahazard
@d8ahazard
Hey there, dumb question - is there a simple way to serialize my entire database into a JSON string?
jeeshenlee
@jeeshenlee_twitter

Sometimes, with LiteDb 5, I will need to trigger Upsert twice for it to be saved into the database. I can't replicate this problem, sometime it works, sometime it wont'.

Can this be a code racing issues?

Any idea why this is happening?

Najem Azdufal (Nesh)
@NajemAzdufal_twitter
Hello togehter, i have updated an older Application from Version 3 to 5. My Idea was to speedup some queries by using projection. What i found out, that it takes more time to receive a projected Result than getting the whole document. ist this right?
danglingneuron
@danglingneuron
How do I query an index for unique values?
micah686
@micah686
I'm having an issue trying to get the autoID mapping working in litedb 5.0.9
public class CharacterTraits
    {
        [BsonId]
        public int Index { get; set; }
        public uint CharacterId { get; set; }
        public uint TraitId { get; set; }
        public SpoilerLevel SpoilerLevel { get; set; }
    }
I then have a List<CharacterTraits> characterTraitsList = new List<CharacterTraits>(); with multiple elements in it. But when I run the following command (dbCharTraits.InsertBulk(CharacterTraitsList);), I get the following error.
""Cannot insert duplicate key in unique index '_id'. The duplicate value is '1'.""
Damian PÅ‚aza
@dpraimeyuu

Hi! I've got a question about performance - I am using FindByOne method on my collection, but it seems like it takes some to load the document from the database. Here's my F# implementation of GetById repository

member this.GetById (id: string): 'a option =
            let mapper = FSharpBsonMapper()
            use db = new LiteDatabase(connectionString, mapper)
            let collection = db.GetCollection<BsonDocument>(collectionName)
            let queryResult = collection.FindById (BsonValue(id))

            Option.fromBson queryResult

As I understood, _id is indexed automatically so it should be rather fast, isn't it? My DB file on the disc has approx. 30MB.

I just want to understand what happens that it's slow :-) I would appreciate any help/clarification

win32nipuh
@win32nipuh
Hi All, I need a help. I have updated LiteDB package in one of my projects from 0.9 to the latest version. All is ok but error:
var files = db.FileStorage.Find(strResource); // <----------------- no FileStorage
foreach (var fi in files)
{
var stream = fi.OpenRead();
return stream;
}
How to fix it ?
win32nipuh
@win32nipuh
Another question: after upgrade nuget from 0.9 to the latest one my app cannot open the existing database
Message = "File is not a valid LiteDB database format or contains a invalid password."
How to fix it?
Torben Stallknecht
@stallemanden
I am not sure, but I would think, that you need to upgrade the DB step-by-step.
I assume, that the upgrade to v5 requires a certain version to be able to upgrade.
win32nipuh
@win32nipuh
You are right, but it is not possible to upgrade v 0.9 to any up version. I have tried to use "upgrade=true" in connection string - does not work. LiteDB studio does not understand this db format too.
Torben Stallknecht
@stallemanden
I had a look at the version release notes. It states for version 1.0.0: To prepare LiteDB to future, version 1.x break compatibility with 0.x. Small external changes, but very important to make a better source structure:
So i guess the only way is to write some sort of conversion program for your data, to get it to a newer version.
win32nipuh
@win32nipuh
Yes, it is one way ....
Another problem using the v5 in comparison with 0.9.
But in the v5 in gives me exception:
{"Unexpected token \\ in position 7."}
How to find this key in the db?
Torben Stallknecht
@stallemanden
@win32nipuh I must admit, I am not that sure about it, but i suspect, that the reason your code is not working as intended is, the big change mentioned before. I have not worked with earlier versions. Anyway, from what I can see, the reason for the error, is the "\" in your string.
win32nipuh
@win32nipuh
@stallemanden I see, you mean: in my case need to replace all '\' with '/' in the db and then search strResource2 = @"monitor/index.html";
ps30
@ps30
@lbnascimento and team can we get an updated NuGet release? It has been 4 months since 5.0.9 and many bugs fixes since then. Can you push a fresh nuget update soon? Thx!
DAVIDSystems
@DAVIDSystems
hi, how do i have to formulate an expression in LiteDB Studio with DateTime : SELECT $ FROM Collections WHERE Status = 'Imported' AND Created > '2020-12-07T00:00:00'; does not work -- Created is DateTime but query shows all documents
mukeshpiplai
@mukeshpiplai
can anyone help me regarding my github query regarding LiteDB
derekone
@derekone
I am trying to find where LiteDB stores my database in C# Visual Studio. any help? I have searched the entire C: Drive and am trying to use it to populate a DataGridView in WinForms. I have been using CSV files but need more functionality to do updates and formulas. Thanks, Derek
Torben Stallknecht
@stallemanden
@derekone if no specific path is given, I would assume together with you application executable.
That's what I see any way.
angelv048
@angelv048
Hello everyone. What is the maximum size that the database can reach? Is there some limitation of the db file size? Thanks in advance!
Torben Stallknecht
@stallemanden
@angelv048 I asked more or less the same question back in Oktober. In essens, what I got from the answer was, that there is no limit. The only limit is the Document size of 1 MB
agreentejada
@agreentejada
Hello everyone, I'm working with the LiteDB nuget package, loving it so far
Quick question: Is it better to use a single LiteDB instance for multiple operations, or get a new object everytime? Right now, I've created a singleton that manages the creation of all my LiteDBs, and I don't dispose of them afterward
larouchefrancois
@larouchefrancois
Hello, I'm looking to use a serverless db for my winform applicaiton and was about to choose SQLite and came upon this awesome library and I'm considering to use it.
However, I have few issues like my objects use parameter constructors and I know by default the mapper doesn't handle that. I searched and saw that there are some solutions but the examples are super simple and I was wondering if anyone knows about a real project at everyone's disposal handling that case. Thanks
larouchefrancois
@larouchefrancois

I did find a workaround though. If I add a private constructor with no parameter it works... That way nobody can call that constructor from outside so my entity integrity is kept. However I feel a bit weird with that though... The real solution would be to create my own mappers that will map to a the LiteDB entity version of the entity and use those in my Repository. Like that I won't touch the object itself, that should be kept pure in its app context regardless its repository DB type.

Any thoughts? Am I missing something that is already built-in?

Julien Amsellem
@ju2pom
Hello, I wonder if it's safe to read a collection at the same time than another collection is being written to (the file is opened in shared mode) ?
derekone
@derekone
@larouchefrancois here is a link to a video from Kimtooflex who uses litedb in the video for his project in part two of his project videos. He's obviously trying to sell a paid service in it but if you look past that(you don't need it) you might find a good example. I'm working on the first video now trying to follow along without using the Benifu plug in he's trying to sell. I'll let you know how it goes when I'm done
@larouchefrancois https://youtu.be/N2GxiAJjExM
Bruno B. de Souza
@knuxbbs
how to see a LiteDB file content in Linux?
larouchefrancois
@larouchefrancois
@derekone Thanks! I'll give a look! :D
derekone
@derekone
@mbdavid Could you put together an instructional video for everyone on how to use LiteDB in winforms?
derekone
@derekone
Anyone have any how to videos in winforms for C#?
larouchefrancois
@larouchefrancois
I just read this statement: "Even if multiple indexed expressions are used on a query, only one of the indexes is used, with the remaining expressions being filtered using a full scan."
So what would be the point to set several index if only one is used?
Also, how can you specify the one you wish to use? Or which one is used by default if there are several?
larouchefrancois
@larouchefrancois
I think I got an answer from how to choose the right index in a previous message made by @mbdavid Eg: Some like this: col.Find(x => x.CustomerName == "John") must be converted to col.Find(Query.EQ("CustomerName", "John"))
But the last question still stands, which is which one is used by default if there are several, assuming that a simple x.CustomerName == "John" would use an index
Jack
@Jacknq
hi, im trying to make this work in v5