Reputation: 57
public class User
{
public string Id { get; private set; }
public string Name { get; private set;}
public bool IsActive{ get; private set; }
}
I am building a .Net application using MongoDB Driver to connect to Mongo. Some of the implemented entities have an IsActive field - basically a boolean which is set to true if the entity is active and false if the entity has been deleted. (A soft or logical delete if you will)
My aim is to apply a "global filter" that would be the base of any filter applied to the given collection. Something like EF Core global query filters https://learn.microsoft.com/en-us/ef/core/querying/filters
Is there anything like this for MongoDB Driver? If not, do any of you have suggestions on how to implement this in any other way?
Upvotes: 5
Views: 795