You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've been using this plugin for a long time now but I have an interesting use-case that I'm trying to solve without actually forking this library. Basically, we already use the plugin to add a tenantId to every mongoose model in our application, but we want to take it one step further. I wanted to add another field to the same model where I could chain the accessorMethod's and continue to narrow down the search. For example:
Basically as it stands right now I have to use User.byTenant("A") to get the model that I need for querying. But what I'd like to be able to do is something like User.byTenant("A").byTenant2("1") which would just return the Aaron user. I know it's not a typical use-case but just wondered if there would be an easy way to implement this. Otherwise if I end up forking it, do you have any recommendations?
The text was updated successfully, but these errors were encountered:
@amerryma So your schema has two or more fields referencing different entities from the same collection? Or do the fields reference different collections? (multiple values from the same dimension or multiple values from a different dimension each?)
Maybe you can explain your use case a bit more in depth to make it a bit clearer what you want to achieve.
Hi, I've been using this plugin for a long time now but I have an interesting use-case that I'm trying to solve without actually forking this library. Basically, we already use the plugin to add a
tenantId
to every mongoose model in our application, but we want to take it one step further. I wanted to add another field to the same model where I could chain theaccessorMethod
's and continue to narrow down the search. For example:User
Basically as it stands right now I have to use
User.byTenant("A")
to get the model that I need for querying. But what I'd like to be able to do is something likeUser.byTenant("A").byTenant2("1")
which would just return the Aaron user. I know it's not a typical use-case but just wondered if there would be an easy way to implement this. Otherwise if I end up forking it, do you have any recommendations?The text was updated successfully, but these errors were encountered: