Storage nodes¶
The "storage" nodes and their respective functions are described in the following sections:
Postgres node¶
The "Postgres" node allows you to read and write the data from a Postgres database. You can set the database queries in the properties of the node. The node delivers the result of the query in msg.payload or in the configuration with optional query parameters in msg.queryParameters. The parameters in the query must be specified as $fieldName. For more information, refer to node-postgres-named.
You use this node to query data form a Postgres database.
Restriction
- At the moment you cannot connect Cloud Foundry Backing Services Instances with Visual Flow Creator.
- You cannot access Cloud-Foundry based databases which belong to third party services.
SFTP node¶
The "sftp" node allows you to read and write files from SFTP server. For more information, refer to SFTP.
You can use the following operations:
- List Directory: It will list the directory content and returns an array of the found files.
- Get: It will get a file from the SFTP server as Buffer object.
- Put: It will create the defined directory on the SFTP server in the specified working directory.
- Delete File: It will delete a file from the SFTP server as per the specified filename.
- Make Directory: It will create a directory on the SFTP server as per the specified working directory.
- Remove Directory: It will remove the defined directory and all sub-directories on the SFTP server in the specified working directory.
Mongodb in node¶
The "mongodb in" node allows you to read data from a Mongodb database. For more information, refer to Mongodb section.
You can use the following operations:
- find: Returns the contents of the database.
- count: Returns a count of the number of documents in a collection.
- aggregate: Provides access to the aggregation pipeline.
Mongodb out node¶
The "mongodb out" node allows you to write the data in a Mongodb database. For more information, refer to Mongodb section.
You can use the following operations:
- save: Will update an existing object or insert a new object if one does not already exist.
- insert: Inserts a new object
- update: Will modify an existing object or objects
- remove: Removes objects that match the query passed in on msg.payload.
Using storage node¶
To get the list of the directories from the SFTP server, follow these steps:
-
From the node palette, drag and drop the "inject" node from the input palette, "sftp" node from the storage palette and "debug" node from the output palette to the working area. Connect the nodes in a flow as shown below.
-
Double click on "inject" node to edit the properties. For more information, refer to Editing nodes.
-
Double click on "sftp" node to edit the properties.
- Enter the "Name".
- Enter the "Host" and "Port" details.
- Enter the "Username" and "Password".
- In the "Operation" section, you can select any one of the following options from the dropdown menu.
- Click "Done".
-
Save and execute the flow.
The output is displayed in the message payload: