Using a MongoDB library project, mongo node not recognised 03.06.2016 06:34 PM
I am new to Flow Designer (free account if that matters) and have not used Node-Red. I have created a couple of flows and have managed to service an http request to fetch M2X data and return that back to the caller. So have a beginner understanding of Flow.
I am trying to use the Mongodb project library named "Generic-CRUD---Mongo-030116-113951". I do get it forked successfully and copied into my project space. When the new project is loaded I see the message "Imported unrecognised type: mongo". The Mongo nodes are shown as dash lined nodes rather than the usual solid line. I assume there is some third party software that is missing, perhaps the Mongo driver package.
I did find the Node-red Mongo npm package "node-red-node-mongodb" that contains some words about running npm install ( I have a working knowlege of nodejs/npm). But this install would appear to be something I run if I have Node-red running locally rather than via the cloud. I did see a question in this forum about how one might add a node.js module however that answer was a bit terse.
In addition to the working knowlege of Node.js/npm I also have an account/database on Mongolab, so am familiar with that. The trouble I'm having is getting my Flow project setup so that I can use Mongolab. I assume the same applies when trying to merge any third party software/driver code into the Flow environment. I just do not see where this is talked about in the docs from the main site.
How does one set up a project to use/access a Mongo database in a Flow Designer environment?
Re: Using a MongoDB library project, mongo node not recognised 03.07.2016 04:15 PM
Ok, got it.
i can use the built in nodes "mongodb" for basic crud. Or I can "roll" my own as normal for a node.js app. require() mongo, then code normally. Looks like the mongo package is available out of the box and does not need to be added as a dependency. (at least for basic find()).
I did test adding a non default package by adding the package name/rev to the code->package.json. It did not seem to always "stick". After commiting/deploying it looked like the package.json file had not been updated. Taking the flow off-line seemed to help, though even that was not always successful. I'm not sure of the exact sequence that was finally successful. After a successfull save/full build then the package was found ok during execution.
So, I think I'm good, for now.
A followup question, is there support for adding a "custom" node type such that it shows on the pallette? If so, is that documented somewhere? If doable and not documented, I can re-ask in another question.