Type tree requirements

To validate JSON documents fetched from a MongoDB collection, a map must use the MongoDB adapter and specify a JSON-based type tree on the input or output card.

To specify the type tree:
  • Optimally, specify the file name of a native JSON document as the Type Tree on the input or output card. The native JSON parser in Design Studio uses the JSON document as the type tree during map compilation.
  • Alternatively, you can use the JSON Importer in Design Studio to create a type tree (.mtt file) from a native JSON document, then specify the .mtt file as the Type Tree on the input or output card.
To create documents, you can use either:
  • A JSON-based type tree.
  • Any type that provides the entire JSON instance document.

MongoDB is a NoSQL database, so the documents in a MongoDB collection can have different fields and structures. Ensure that the JSON document you use as a type tree represents the documents in your collection.

Any document you insert into a MongoDB collection must be a JSON document.