Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 26 10:26
    jurasans commented #2232
  • Sep 22 13:22
    LazarQt commented #2221
  • Sep 22 06:55
    devmaestro1 edited #2241
  • Sep 22 05:23
    devmaestro1 edited #2241
  • Sep 22 05:22
    devmaestro1 edited #2241
  • Sep 22 04:57
    devmaestro1 edited #2241
  • Sep 22 04:23
    devmaestro1 edited #2241
  • Sep 22 04:23
    devmaestro1 labeled #2241
  • Sep 22 04:23
    devmaestro1 opened #2241
  • Sep 21 12:14
    gjvanvuuren commented #2221
  • Sep 21 02:02
    LazarQt commented #2221
  • Sep 20 14:26
    yisman commented #1790
  • Sep 20 14:26
    yisman commented #1790
  • Sep 20 14:26
    yisman commented #1790
  • Sep 19 06:47
    pjy612 commented #2238
  • Sep 19 06:44
    pjy612 commented #2238
  • Sep 17 03:00
    DragonXYZ closed #2240
  • Sep 17 02:59
    DragonXYZ commented #2240
  • Sep 16 22:17
    stephenhauck commented #2240
  • Sep 16 14:22
    500lb-Bench closed #2239
Damien Doumer
@DamienDoumer
I'm having a this litedb error on Xamarin Android, The only time I close my litedb connection (call Dispose()) is when "Activity. Destroy" is called. But I get errors like: DiskReader.ReadStream (System.IO.Stream stream, System.Int64 position, LiteDB.BufferSlice buffer)
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Stream has been closed'.
Can someone please help ? is there a trick somewhere ?
Jin-Wook Chung
@jwChung
Hello, I left a question on SO as I had a question about LiteDB's connection mode. If you have time, I would appreciate it if you could look at my question.
Paramjit Singh
@HobDev
Hello All, Is LiteDB ready for DotNet Maui
Timothy
@timothyparez
I am using it on Android, given that it's fully managed code, I'd say 99% it's MAUI ready
nomadev
@nomadev:matrix.org
[m]

Hello! I would like to select two field from my root document: RootProp and ChildProp (which is an array of objects), based on a condition:

SELECT $.RootProp, $.ChildProp[@.Name = 'ChildPropName'] FROM MyCollection WHERE COUNT($.ChildProp) > 0

My goal is to get only those results that have a populated ChildProp array (Where statement). However in the results I get also those records which do not contains any element on the ChildProp array. What am I missing? thanks

nomadev
@nomadev:matrix.org
[m]

:point_up: Edit: Hello! I would like to select two field from my root document: RootProp and ChildProp (which is an array of objects), based on a condition:

SELECT $.RootProp, $.ChildProp[@.Name = 'ChildPropName'] FROM MyCollection WHERE COUNT($.ChildProp) > 0

My goal is to get only those results that have a populated ChildProp array (Where statement). However in the results I get also those records which do not contains any element on the ChildProp array. What am I missing? thanks

jerryfan
@jerryfan
Has anyone here used LiteDb for application state management?
bluekuen
@bluekuen

Hello! I need help in updating a list in my User table:
i have a Table called User. The User has a List with Devices.
Now i changed my Device assembly and namespace and now i need to change the Type (_type) of my Devices.
I tried so many approaches but nothing did work and im out of ideas. The last command i tried was:
'''UPDATE User SET Devices = Devices[]._type = 'DeviceSet.Mobile.Models.BleDevice, DeviceSet' ''' which gave me following Error:
Left expression `MAP($.Devices[
]=>@._type)` returns more than one result. Try use ANY or ALL before operant.

I'm looking forward to any help!

JeeShen Lee
@jeeshenlee

Hello, I recently changed a field's data type from int to string.

After the changes, I'm getting "Casting Exception" when I try to read the records.

I did some reading and notice that I need to manage the new schema using DatabaseVersion. In order to change the schema, I need to perform the migration to the existing database. Is this the right way to do? Any other idea?

JeeShen Lee
@jeeshenlee

I went ahead to implement the migration to change the data type by resaving the BSONValue.

After that, I increment the database version to 1.

Now, how do I mark a newly created database to version 1 so it won't have to go through the migration (migration is meant for existing database).

Rafał Piotrowski
@rafalpiotrowski:matrix.org
[m]
Hi, can I force litedb to flush data to disk? My problem is that after update and shortly after when I read the data is not reflecting the changes made by update!
Rafał Piotrowski
@rafalpiotrowski:matrix.org
[m]
BTW. I am calling Checkpoint and I have also set CheckpointSize to 0 to manually call Checkpoint.
ajay kishore
@ajaykishore666_twitter
I have dotnetnuke db file, can i open that in litedb. how to view other db files in litedb with different extensions(not the .db)
Tim Moore
@tjmoore
Hi, what does this error mean? Google turned up only one result and it's in Chinese!
      System.Exception: LiteDB ENSURE: get only index below highest index
         at LiteDB.Constants.ENSURE(Boolean conditional, String message)
         at LiteDB.Engine.BasePage.Get(Byte index)
         at LiteDB.Engine.IndexService.DeleteAll(PageAddress pkAddress)
         at LiteDB.Engine.LiteEngine.<>c__DisplayClass3_0.<Delete>b__0(TransactionService transaction)
         at LiteDB.Engine.LiteEngine.AutoTransaction[T](Func`2 fn)
         at LiteDB.Engine.LiteEngine.Delete(String collection, IEnumerable`1 ids)
         at LiteDB.SharedEngine.Delete(String collection, IEnumerable`1 ids)
         at LiteDB.LiteCollection`1.Delete(BsonValue id)
Tim Moore
@tjmoore

I know LiteDB is probably not ideal for this, but is there any advice on deployment on a active/standby cluster?

Due to customer requirements project I'm working on has been deployed this way and the .db files are replicated to the standby. Failover occurs and in theory it picks up on the standby.

It appears to work in testing but there's concern that it may not be robust and have reports of some issues that haven't been reproduced (and no errors logged). May be totally unrelated, but want to check if anyone has deployed on such a cluster set up.

Long term the aim is to implement Mongo DB or similar for this.

Alex Sinitsky
@thryl
Hey guys, getting an exception while trying to do thebase.Insert(rec) - "this page should be in slot #0". Interestingly, the exception isn't thrown in debug, and Insert actually works correctly. I've checked why does it throw and found out the slot is 1 instead of 0, thus ENSURE throws an exception. Does anybody know what might be the issue here?
Paramjit Singh
@HobDev
Hello all
I want to save ordered items by date in LiteDb like this
IEnumerable<Destination> orderedList = destinations.OrderBy(d => d.TripStartDate);
tripContext.Destinations.Insert(orderedList);
But when I access the Destinations in the app it is not in correct order by StartDate
Am I doing something wrong. Please help
Matthew Oh
@newbiz90:matrix.org
[m]
1 reply
Shahab Ouraie
@th3r0b0t

Hello everyone @/all
I'm new to whole this, so plz correct me if I'm wrong:
1- A poco class when inserts into DB known as a Document;
2- If a poco class contains an object property of another poco class, this is a SubDocument;

Questions:
1- Does $ symbol refers to the main poco class/Document when used in LINQ-expressions?
2- Whats different between SELECT $ from students and SELECT * from students (Basically * and $)?
3- Whats is and the difference between Collection and Document ?

tnx in advance; Couldnt find out through docs...

ariana strangelove
@dangergrrl:matrix.org
[m]
Hi :)
oh nvm, i can read the source
Scott Wolf
@wolfson292
Is there any method to run a repair on a database. I am getting the following exception when trying to open a file.
System.Exception: LiteDB ENSURE: ReadFull must read PAGE_SIZE bytes [4096]
   at LiteDB.Constants.ENSURE(Boolean conditional, String message)
   at LiteDB.Engine.DiskService.ReadFull(FileOrigin origin)+MoveNext()
   at LiteDB.Engine.WalIndexService.<>c__DisplayClass19_0.<<CheckpointInternal>g__source|0>d.MoveNext()
   at LiteDB.Engine.DiskService.Write(IEnumerable`1 pages, FileOrigin origin)
   at LiteDB.Engine.WalIndexService.CheckpointInternal()
   at LiteDB.Engine.WalIndexService.TryCheckpoint()
   at LiteDB.Engine.LiteEngine.Dispose(Boolean disposing)
   at LiteDB.Engine.LiteEngine..ctor(EngineSettings settings)
Ilya Popov
@ijamon
@wolfson292 LiteDB Studio?
Hi guys, could you help. How can i do postgres-like "DO NOTHING" for Upsert on needed property?
Sébastien Duterte
@Feulito_gitlab
Hello guys !
I need some help with an error with a "LiteDB ENSURE exception : page type must be collection page".
Do you know how this error occurs ? Is it possible to get this error when the database is killed brutally (without dispose, for exemple) ?
LP
@grofit

I am looking at integrating this with an existing project, so we already have data models etc but we already have a Guid based Id field, is there a way to hint/tell Lite DB to just use that field to be the id .

Not fussed if it duplicates the custom Id into _id or some other mechanism, I just need to be able to query on the Guid not the BsonValue based Id, although I appreciate I may externally use a Guid in my data access layer but internally it may have to just make a BsonValue on the fly or something...

Anyway any advice on this would be great as I assume its a common use case, just couildnt find much in the docs around it

LP
@grofit

Also I have a query around dynamic style types, i.e I have a class with an interface property so when deserializing its not clear what C# type it is.

When I was using JSON.Net I had a custom JsonConverter which handled that part, but im not entirely sure here how to mimic that with LiteDB, historically all the data used to be pumped out to raw json files using JSON.Net so generally it seems a good fit for just moving each json file to be its own collection, but not quite sure how to work around that bit

LP
@grofit
I have put a question about this on stack overflow so if anyone does read this and knows please put the answer in there https://stackoverflow.com/questions/73611168/any-way-to-mimic-jsonconverter-style-serializing-deserializing-of-complex-object
LP
@grofit
For now im just going to introduce an intermediate JSON layer in our repositories which converts them into BsonDocuments and hope for the best :D
BuechnerA
@BuechnerA

Dim Result = m_Col.Find(Function(x) x.Name.StartsWith("F")).ToList
--> If an entry starting with "F" is found, I get this exception:

System.NullReferenceException: "The object reference was not set to an object instance.

--> If no entry starting with "F" is found, I get an empty list "Result" (LiteDB.LiteCollection(Of T)

Where is my problem? Thanks for quick help!

Sorry: list "Result" (List(Of T))
LP
@grofit
are all the types correct in all the bits you use i.e all Generics match
and also are all the bits you expect to be populated/deserialized on the object populated in the collection store?
BuechnerA
@BuechnerA
I have found the cause: I had "only" a separate constructor with special parameters in the class and removed the standard constructor. Thanks for all the help.