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

Get document with current version #48

Open
hsd99 opened this issue Mar 29, 2021 · 1 comment
Open

Get document with current version #48

hsd99 opened this issue Mar 29, 2021 · 1 comment

Comments

@hsd99
Copy link

hsd99 commented Mar 29, 2021

Hello,

Very nice library. I have a question how to get only documents with current version?
So we can have two documents

Cars: [
{"Name": "Audi", "Version": "1.0.0"},
{"Name": "VW", "Version": "2.0.0"}
]

Current version of model is "2.0.0".

[RuntimeVersion("2.0.0")] 
public class Car
....

Will be great to use:

mongoCollection.FindAsync(_ => true);

and get only one 'VW' car in case when migration is not defined. I have use case when I have service on many instances and migration cannot be done in one step. First all services instances need to be upgraded and next we can migrate documents.
In that situation I have two deployments: first to create new documents with new version and upgrade all services in some time and second migrate old documents.

Do I miss something? Can be this topic on the focus in development?

@SRoddis
Copy link
Owner

SRoddis commented Sep 28, 2021

Hey @hsd99,

I am not sure if I totaly understand the use case.

This library has its focus on migration documents. It will not be able to filter them for you, but it will migrate them. So if you want to work with different version, then you should handle the case your self.

Let me know if you have any further questions. This issue will stay open the next two weeks.

Cheers,
Sean

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

No branches or pull requests

2 participants