Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
  • May 04 12:33
    jez9999 commented #1275
  • May 04 03:45
    haiduong87 commented #1998
  • May 02 14:45
    AlBannaTechno commented #1953
  • May 02 04:00
    rexcardan commented #1992
  • May 02 03:58
    rexcardan opened #1998
  • Apr 29 14:48
    Dieveral labeled #1997
  • Apr 29 14:48
    Dieveral opened #1997
  • Apr 29 10:35
    rubit0 commented #844
  • Apr 29 10:31
    rubit0 commented #844
  • Apr 29 10:31
    rubit0 commented #844
  • Apr 29 07:06
    haiduong87 commented #132
  • Apr 29 04:51
    haiduong87 commented #1707
derekone
@derekone
@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.
alt160
@alt160
is it possible to get the document 'type' from a BsonDocument? If i wanted to store different types in one database (Person, Company, and Job), how could i enumerate each type in the database? For example if I use _db.GetCollection<Person>(), will the underlying BsonDocument contain the .NET classname?
tengulak
@tengulak
Hi, its looks like Query.Not not working on lastest LiteDB 5.0.10 version, i tried on table with string _id. Query.EQ (=) working ok, but Query.Not (!=) not !!!!!!!!!!!!
winkmichael
@winkmichael
Hello all, I believe this is a bit of a repeat question (sorry). I see mention of a MAC client, is there a MAC client that Google is not helping me find?
That being a OSX version of the LiteDB.Studio
Amleto
@Amleto
Hello. I was wondering if there are any extensions or utils that help to insert/upsert entities when they are added as a dbref in another collection?
Ruslan Mogilevskiy
@ruslanmogilevskiy
Hi there. Could someone unveil how to select the records that contain Dictionary<string, string> property by dictionary's key and value? I.e. I have a Foo class with 'public Dictionary<string, string> Bar' property and I need to select all (or single) Foo that have the key='k1' and value='v1' in its Bar dictionary. I tried collection.FindOne("Bar[*].k1 any in @1", "v1") but it always returns NULL.
Amleto
@Amleto
Wouldnt you need to start with "Foo.Bar... ?
Ruslan Mogilevskiy
@ruslanmogilevskiy
@Amleto , no because collection is strong typed, i.e. collection = db.Collection<Foo>() so the entity name is known.
tried with Foo.Bar[*]... doesn`t work as well
is there any documentation related to any/all out there? Found nothing neither in query samples nor in wiki\docs\api documentation
square brackets looks like its for a list
did you try {} for doc/dict?
also seem syou should start with $.Bar
it's Evidenty not very active here. Try on a programming/c# discord
Ruslan Mogilevskiy
@ruslanmogilevskiy
do you mean Bar{*}.k1 any in '1'? - query format error
Start the query with $. doesn`t work as well
Amleto
@Amleto
well theres no example at all that starts with a property name
Ruslan Mogilevskiy
@ruslanmogilevskiy
yeh ((
Amleto
@Amleto
actually:
"The $ symbol are optional and default in document navigation (Address.Street works too)"