Mongo.Migration icon indicating copy to clipboard operation
Mongo.Migration copied to clipboard

Get document with current version

Open hsd99 opened this issue 4 years ago • 1 comments

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?

hsd99 avatar Mar 29 '21 13:03 hsd99

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

SRoddis avatar Sep 28 '21 15:09 SRoddis