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

How to change MongoDB collection dynamically based on request. #473

Closed
bvenky27 opened this issue Sep 30, 2018 · 1 comment
Closed

How to change MongoDB collection dynamically based on request. #473

bvenky27 opened this issue Sep 30, 2018 · 1 comment

Comments

@bvenky27
Copy link

bvenky27 commented Sep 30, 2018

Description/Steps to reproduce

The issue is similar to issue strongloop/loopback#2603
I want to change my model's collection on MongoDB dynamically for each call. For this I need to override the method "collectionName" of loopback-mongodb-connector. How to override this method and also mechanism to provide collection name to the "collectionName" method. If this is the wrong approach then can you please suggest me any better approach? Any help would be much appreciated.

Link to reproduction sandbox

Expected result

Additional information

@bvenky27
Copy link
Author

bvenky27 commented Oct 1, 2018

I was able to solve it using the override methods guide mentioned in docs.

@bvenky27 bvenky27 closed this as completed Oct 1, 2018
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

1 participant