Comments (14)
Hi @sherry-ummen, the problem is: you are serializing an Object
(in this case, a List<Object>
).
LiteDB serialize/deserialize objects using object type to know where put a field data. To serialize is a problem, but when you try to deserialize it´s not possible because there are no destination type to match all document (BsonDocument
).
from litedb.
Thanks David.
Is it possible to improve this? Since the same code for MongoDb works pretty nicely.
Sent from my Windows Phone
From: Mauricio Davidmailto:[email protected]
Sent: 30/04/2015 17:30
To: mbdavid/LiteDBmailto:[email protected]
Cc: Sherry Ummenmailto:[email protected]
Subject: Re: [LiteDB] Object not being serialized or deserialized correctly? (#27)
Hi @sherry-ummen, the problem is: you are serializing an Object
(in this case, a List<Object>
).
LiteDB serialize/deserialize objects using object type to know where put a field data. To serialize is a problem, but when you try to deserialize it´s not possible because there are no destination type to match all document (BsonDocument
).
Reply to this email directly or view it on GitHub:
#27 (comment)
from litedb.
I will made some tests with MongoDB driver to know how they store a document from an Object
. I will add to my todo list and try to be avaiable in next version
from litedb.
Great thanks David.
from litedb.
There is a new version on Nuget/Github Release: 1.0.1 fixing this problem.
from litedb.
hi,
I tested it but still my issue was not fixed with the changes. So I quickly had a look at whats wrong and did some small changes to get it working with my code. Here is the commit
sherry-ummen@121fbf0
All the unit tests pass.
from litedb.
Hi @sherry-ummen, thanks for your feedback. I will test your code and join this issue with #31 that is same problem. Now I do more tests before release new version.
from litedb.
Hi @sherry-ummen, I use part of your code to create implement deserialize to IList<>
and IDictionary<,>
. Can you test master
branch in your app? Thanks
from litedb.
thanks @mbdavid ur fix works like charm 😃
from litedb.
oops hold on seems one case still not working. I will let you know soon. Sorry for being joyous too early :)
from litedb.
Sorry for late reply as I was on vacation. So the case which did not work was when you put the property value to be Enummerable.Range(1,9999) then it failes with exception index out of bound.
You/me can create a seperate issue if you like for this.
it works in mongodb.
from litedb.
Hi David,
I want to ask one thing.
Can we somehow make a mechanism to avoid this overhead of Start and End transaction. I just want to write it without that and just leave rest to the underlying API to write.
I tried a simple test that where I am doing random read and write and for that I always have to Start and End transaction for write which slows down the process.
Any solution or suggestion?
Thanks
Sent from Windows Mail
From: Mauricio David
Sent: Sunday, May 24, 2015 12:54 AM
To: mbdavid/LiteDB
Cc: Sherry Ummen
Closed #27.
—
Reply to this email directly or view it on GitHub.
from litedb.
Hi @sherry-ummen, I open a new issue for this bug: #38
About start/end transaction: I use transaction to avoid concurrency writes. Transaction lock datafile so there is no 2 users writing at same time.
It´s quite ease to "remove" this, if you want more performance and less overhead.
I´m planning to v.1.1 create a Stream layer to control this - so you can use MemoryStream, assembly resource stream or even FileStream without transactions, locks and journal writes. More performance but less control - ideal do one user application.
from litedb.
Nice I eagerly wait for that.
Could you also provide a property or some configuration parameter to the LiteDB so that we can set the max BsonDocument size also? I can always compile it by myself also but thought that 1 Mb is still quite low and can easily shoot up in case heavy geometry app.
I am planning to test this in a real heavy write and read in an intense desktop application.
Sent from Windows Mail
From: Mauricio David
Sent: Thursday, May 28, 2015 7:55 PM
To: mbdavid/LiteDB
Cc: Sherry Ummen
Hi @sherry-ummen, I open a new issue for this bug: #38
About start/end transaction: I use transaction to avoid concurrency writes. Transaction lock datafile so there is no 2 users writing at same time.
It´s quite ease to "remove" this, if you want more performance and less overhead.
I´m planning to v.1.1 create a Stream layer to control this - so you can use MemoryStream, assembly resource stream or even FileStream without transactions, locks and journal writes. More performance but less control - ideal do one user application.
—
Reply to this email directly or view it on GitHub.
from litedb.
Related Issues (20)
- Make all internal Task SyncContext agnostic HOT 2
- [BUG] LiteDB Docs FileStorage section "fs.Find("$/photos/2014/");" not supported in v5
- [SUGGESTION] Upgrade Framework dependencies HOT 1
- [QUESTION] Parameterized queries not working?
- ArgumentException when fetching db item with missing Enum value HOT 2
- [QUESTION] Save :memory: to disk? HOT 2
- [BUG] HOT 1
- [QUESTION] UpdateMany with Dictionary<string, object>
- [QUESTION] please need example for https://www.litedb.org/docs/encryption/
- Regression [BUG] LiteDB.LiteException: ReadFull must read PAGE_SIZE bytes [{0}] HOT 3
- [QUESTION] Upgrading database created with v3 doesn't work in v5
- [BUG] Detected loop in FindAll({0}) HOT 1
- [BUG] Getting into a rare and unrecoverable state after 5.0.21 HOT 1
- Getting list of Ids from collection throws Unable to cast object of type 'LiteDB.ObjectId' to type 'System.String'
- [BUG] LiteDB will return null for DB entries by the very first access
- [BUG] The LiteDB not shower value type long to private property HOT 2
- [QUESTION] Unset a a property HOT 2
- [CONTRIBUTION] Schema Migrations for LiteDb - introducing LiteDbMigrations HOT 2
- [BUG] First level .Include(...) doesnt matter HOT 2
- [BUG] iterating over an IEnumerable<LiteFileInfo<TFileId>> errors out on the second element if the DB is opened in shared mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from litedb.