The MongoDB Output tool is used for writing data to MongoDB databases. MongoDB is a scalable, high-performance, open source NoSQL database. You can learn more about MongoDb here: http://www.mongodb.org/.
MongoDB databases store data in a BSON format which is binary JSON. You can learn more about BSON here: http://bsonspec.org/
Server:The name of the MongoDB server you wish to connect to. Enter localhost to connect to a MongoDb instance you have on the machine running Alteryx.
Database:The name of the MongoDB database you wish to connect to.
Collection:The name of the MongoDB collection you wish to push data to.
UserName/Password (optional):If your MongoDb instance is running with the âauth option this is where you enter the username/password you wish to connect to.
Output Options:
Append Existing:Append the new records onto the end of your collection
Delete Data & Append:Deletes the collection and then adds the new records
Update Using _id:Will attempt to match an existing record using the MongoDB _id element to the field specified in â_id fieldâ. If a match is found then the existing record will be updated with the new one. If no match is found then the new record will be appended onto the collection.
_id Field:Used to select the Alteryx field which contains the _id value when using âUpdate Using _idâ mode. Note if you wish to update based on the MongoDb generated ID then this should be a JSON object e.g. { "_id" : { "$oid" : "4fad55603346998a9f7d6841" }}
BSON view:The tree view at the bottom of the tool configuration provides a visual representation of what the BSON object will look like which is going to be inserted into your collection.
The default options uses the dot notation to build the structure of the BSON object so for example passing fields MemberID; Name.First; Name. Last would by default give you a JSON object which looked like this { MemberID: 123, Name : { First : âAlistairâ , Last : âTerryâ } }.
However you can restructure the BSON object to look however you would like by using the up/down/add/remove buttons.
Name:Allows you to rename any given BSON element (Note: BSON names cannot begin with $ nor contain â.âs)
Folders:
As Name/Value: Will create child nodes as name value elements e.g. Name : { First : âAlistairâ , Last : âTerryâ }
As Array: Will add child nodes as member of an array e.g. Name : [âAlistairâ , âTerryâ]
Mode:(for the incoming Alteryx fields)
Data is Value: The data in the Alteryx field is plain data to add to the data element of the BSON pair.
Data is JSON: The data in an Alteryx string field is already a JSON and should be appended as such.
Data is BSON: The data in an Alteryx blob field is already a BSON and should be appended as such.
Unknown Fields:
Position Using Field Name: The unknown fields will be positioned using the dot notation of their names. Starting with the location of the Dynamic or Unknown Fields node as their root position.
Position as Left: The unknown fields will added wherever the Dynamic or Unknown Fields node is positioned.
©2018 Alteryx, Inc., all rights reserved. Allocate®, Alteryx®, Guzzler®, and Solocast®