Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom TypeDescriptor field #1982

Open
skadefro opened this issue Apr 9, 2021 · 2 comments
Open

Allow custom TypeDescriptor field #1982

skadefro opened this issue Apr 9, 2021 · 2 comments

Comments

@skadefro
Copy link

skadefro commented Apr 9, 2021

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.

@mbdavid
Copy link
Owner

mbdavid commented Apr 10, 2021

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.

@skadefro
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants