Closed skadefro closed 4 months ago
Hi @skadefro,
If you are mapping documents between two databases that need this same _type
column you need to consider create a custom BsonMapper
class that use this new rules. You need to use a single object instance of this class in your LiteDatabase
ctor
.
Hi mbdavid, I'm sorry if I'm missing something obvious, but I tried copying the BsonMapper class with my updates, to my own project, so I can use it in the LiteDatabase constructor. But that will not work since LiteDB.Constants, LiteDB.Reflection, LiteDB.LinqExpressionVisitor and maybe more are all internal.
I created a fork with this work around. I'll close this issue to not keep issue open that will not be fixed/implemented.
Is your feature request related to a problem? Please describe. I want to use lidedb as a local cache for a system that uses mongodb as a backed. But I already use _type for something else and that gives issues with litedb.
Describe the solution you'd like I would like to suggest adding a TypeDescriptor property on the BsonMapper class to allow a custom name for this field
Describe alternatives you've considered Have not considered any alternatives
Additional context I have opened a pull request with the suggested feature.