I want to change "collections" (string) from front end? How to do that?
For further actions, you may consider blocking this person and/or reporting abuse
For further actions, you may consider blocking this person and/or reporting abuse
Mihovil Ilakovac -
iskurbanov -
Nitin Sharma -
David William Da Costa -
Once suspended, ivkemilioner will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, ivkemilioner will be able to comment and publish posts again.
Once unpublished, all posts by ivkemilioner will become hidden and only accessible to themselves.
If ivkemilioner is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to ivkeMilioner.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag ivkemilioner:
Unflagging ivkemilioner will restore default visibility to their posts.
Top comments (3)
Hey @ivkemilioner, for starters I recommend tagging your post with
help
to reach more people.Anyways, if I understand your question correctly, you want to pass
collections
as an outside parameter to your API endpoint? I recommend checking the documentation, you can use query parameter to pass data to your endpoint.For example, if you access your API route like this:
/api/qapages?collection=questions
, you can read thecollection
query parameter viareq.query
:However, make sure to validate the incoming parameter so it's possible to access only collections which should be accessible this way.
Thank you very much! I fixed !
hi @ivkemilioner i have a suggestion 😁 you can use singleton pattern to create a one time connection to database and then reuse that connection so that you need not call connectToDatabase over and over