mbdavid on master
Fixed issue #1772: Unfortunatel… Merge pull request #1906 from f… (compare)
\\
in position 7."}
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?
Eg: Some like this: col.Find(x => x.CustomerName == "John") must be converted to col.Find(Query.EQ("CustomerName", "John"))
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.
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
}
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.
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.
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);