❔ MongoDB: Cache conventions
Hello, I'm trying to figure out what's a better convention for caching records in my API application.
What I currently do:
Depending on the filters I have selected (list search page, finding a specific record, etc), I send that as a filter definition into the
MongoDb<T>.Find(_Filter)
method.
Now for the sake of caching, these filter definitions would not work if I'm correct, so I would need to first load all records into Cache, then do filtering.
What's the recommended way of doing this?
>Create Filter Query -> Search Db -> Get Results
>Get All Results -> Create Filter Query -> Query Results2 Replies
To be clear: I'm aware that the second option is the better option, I was wondering if there are other options besides these two that's perhaps outside my knowledge
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.