Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 08 21:39
    haiduong87 commented #1998
  • May 08 17:27
    u1-liquid edited #2002
  • May 08 17:24
    u1-liquid edited #2002
  • May 08 17:23
    u1-liquid labeled #2002
  • May 08 17:23
    u1-liquid opened #2002
  • May 08 16:30
    jakerdy opened #2001
  • May 08 16:30
    jakerdy labeled #2001
  • May 06 10:58
    marmales edited #2000
  • May 06 10:58
    marmales edited #2000
  • May 06 10:57
    marmales edited #2000
  • May 06 10:57
    marmales opened #2000
  • May 06 10:57
    marmales labeled #2000
  • May 05 04:02
    Joebu edited #1999
  • May 05 04:01
    Joebu edited #1999
  • May 05 04:00
    Joebu opened #1999
  • May 05 04:00
    Joebu labeled #1999
  • May 05 03:46
    ryancheung commented #1472
  • May 05 03:00
    ryancheung commented #1472
  • May 05 02:56
    ryancheung commented #1472
  • May 05 02:53
    ryancheung commented #1472
win32nipuh
@win32nipuh
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
SELECT $ FROM post INCLUDE categories,tags where ANY( $.Categories[*].$id = 7) but getting > Left expression MAP($.Categories[*]=>@.$id) returns more than one result. Try use ANY or ALL before operant.
Jack
@Jacknq
ah, found out myself, SELECT $ FROM post INCLUDE categories,tags where $.Categories[*].$id any in 7 thanks for this amazing work guys! put more examples in docs, thanks! just keep on going
Tim Moore
@tjmoore

Hi, we have a service web API application that we're developing that runs on multiple platforms but over the holiday period our testers have found an issue when the service has been left running on linux (CentOS based system). When using the application there is a database call using shared mode and on opening the database it's throwing IOException on the global mutex.

Is there something I need to be doing to handle this situation (mutext has timed out or something?)

System.IO.IOException: The system cannot open the device or file specified. : 'Global\\A4BC81403E0F366B89A06D796FC65AC91A2AEF11.Mutex'
   at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at LiteDB.SharedEngine..ctor(EngineSettings settings)
   at LiteDB.ConnectionString.CreateEngine()
   at LiteDB.LiteDatabase..ctor(ConnectionString connectionString, BsonMapper mapper)
   at LiteDB.LiteDatabase..ctor(String connectionString, BsonMapper mapper)

Construction of LiteDatabase is effectively via this code...

using (var db = new LiteDatabase("filename=database.db;Connection=shared;ReadOnly=true") { UtcDate = true })
{
    // do work
}
mikeprag
@mikeprag
Hi...New to LiteDB but so far really loving it..Question: I have 2 databases, one on the server and one on a local machine. My app uses the local version but then I want to give the user the ability to synch their changes to a server version and then other users to pull down those changes. What's the best way to write a query to find the differences between the 2 collections of the database or is the only way to go through each item in the collection and try and find it in the other DB? Thanks in advance for any help
jeeshenlee
@jeeshenlee_twitter

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) ?

@ju2pom Based on my understanding, it's safe to read and write to the same collection at the time using LiteDb. But I would suggest not to use "Shared" connection string though, I ran into some problem trying to do so in one of my projects. I solved it by using a Singleton repo layer for my app.

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) ?

@ju2pom Based on my understanding, it's safe to read and write to the same collection at the time using LiteDb. But I would suggest not to use "Shared" connection string though, I ran into some problem trying to do so in one of my projects. I solved it by using a Singleton repo layer for my app.

Thanks @jeeshenlee_twitter for your answer, sadly I can't use the Direct mode because I have also two processes accessing the same database.

Gerard Burger
@gtnb_twitter
Hello, I was wondering how to write a whole LiteDB database existing in memory to disk, without having to write all tables etc. to a new database? It is a simple database, no FileStorage needed.
I load the database using the method in issue #346, but the File.WriteAllBytes() call at the end of the code does not write the changes made to the tables in memory back.
Due to the nature of my program I cannot use a 'using' statement, so I try to write the db back with:
File.WriteAllBytes(ConnectionString, memdb.ToArray());
db.Dispose();
memdb.Dispose();
But as I said, that does not write the changes to disk.
Gerard Burger
@gtnb_twitter
Sorry, I mean issue #349.
Fungusware
@Fungusware

Hi all. I'm trying to find the best way to query a large collection of documents, which include a byte[]. I need a fast way to find the most recent Timestamp filtered by an Id

I currently have

var qry = col.Query().
Where(x => x.SensorId == sensorId).
OrderByDescending(x => x.TimeStampUTC).
Limit(1);

But it perform very slow.
Eric Vollenweider
@EricVoll
Hi everybody,
I am using v4.1.4 and am trying to change the password of a db using Shrink(). I get a OutOfMemoryException since it takes >2GB of Ram for a 500MB DB file. This issue is discussed here (mbdavid/LiteDB#531) but doesn't seem to solve my issue or be to in v4.1.4.
Can anybody help me to figure out a solution? Thanks!
(I'll gladly provide more info if needed...)
LBarthe
@LBarthe
Hello, I'm looking for something like this :
GetCollection.Query().Where([LiteDB.Query]::Contains("$a",$Search)-or("$b,$Search"))
But i can't find the solution.
For more info, i use powershell. Thanks !
Paul Smith 🌷🇬🇧
@PJSmith_twitter
Hello All. Having trouble trying to find docs and code examples for insertbulk. I am trying to do this for performance reasons instead of lots of .Insert. Can anyone point me in the right direction? I'm thinking I can just add all my class items to a List and bulk insert the list in one operation, but I'm a little out of my depth without some examples :) Thanks!
LxLeChat
@LxLeChat
hello all ! i'm new to nosql ... so i wanted to know if someone could help me with some queries i'm trying to build ! I found LiteDB and find it super helpful!
I'm trying to use it with powershell !
LBarthe
@LBarthe
Hi @LxLeChat ! You can do something like this $GetCollection.Query().Where([LiteDB.Query]::Contains("Name",$MyVar), you can find few help here https://smsagent.blog/2020/11/23/using-a-litedb-portable-database-with-your-powershell-project/
LxLeChat
@LxLeChat
sweet! i ll check it out !
Raí Toffoletto
@raibtoffoletto
Hey Folks, I wonder if any f you can help me, I started a new job (as frontend) and they putted me to work on a project that I'm having to rebuild the dotnet backend. It uses LiteDB to store data (any data, from csv, excell) in different DBs for different datasets. I'm wondering that is anyway to access this data without mapping it to a poco class.... they way the person before me solved the problem is very buggy, so If anyone can just point me in the right direction I'll be super glad! Thanks in advance for any tips :)
Mi.Chi
@AlessioMiky76_twitter
@raibtoffoletto im developing a framework that do what you need. There is an old preview here: alemik.com. If it is intersting for you contact me by email.