Skip to content

Cannot retrieve node-red-node-mongodb query status #490

Description

@mickev36

Hi,

I think the OUT node for node-red-node-mongodb (which is provided with the extra nodes package) should provide an output, so we can process the status of the query (Did it fail ? Did it succeed ? When ?).

Simple real case : I'm exposing an HTTP endpoint updating a document in a mongo DB. As of right now, I have no means to send the HTTP response WHEN the query is done, or to provide details on the success of the query in the HTTP response. My only option is to send a HTTP 200 when the HTTP endpoint is called, meaning I cannot send an error response when/if the node fails.

I was suggested on the node-red forum to use the status node to catch status emitted from the mongo node, but with this method, I cannot keep the http related properties (msg.req, etc...) to send to the http out node (since you can only pass fill, shape and text properties with status, where you can send a whole object with node.error for example).

I'm willing to implement this if needed.

Have a good day

Activity

  1. hardillb commented on Sep 14, 2018

    @hardillb
    Member

    Hi, as mentioned in the template you deleted before raising this issue, we prefer feature requests to be raised and discussed on slack or the forum rather than in issues. We try and keep issues for actual code defects.

    In this case look at the catch node which can be used to detect failures.

  2. mickev36 commented on Sep 14, 2018

    @mickev36
    Author

    Hello,

    I've posted on the forum, but only had one answer which was the "status" proposal. It doesn't solve the problem, as I can't use this method to conserve http.req properties for the http out node. The thread starts to be buried, and I have no solution except for maintaining a fork, which sounds overkill.

    The catch node also cannot be used : the mongo node doens't emit an error on a query success.

    This is to me is an actual defect : there is no way as-is to use the mongo node for a HTTP endpoint, answering only when the query is done.
    I found no example on the web using this node (it looks like people are switching to mongodb2 which is not in the "official" extra node package).

  3. mickev36 commented on Feb 12, 2019

    @mickev36
    Author

    Opened a PR on this issue : #517

    I will close this issue once the PR is resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions