Schema requirements
To validate JSON documents fetched from a MongoDB collection, a map must use the MongoDB adapter and specify a JSON-based schema on the input or output card.
To specify the schema:
- Specify a previously imported JSON document as the schema for the input or output card or action. The native JSON parser in Link uses the JSON document as the schema during map compilation.
To create documents, you can use either:
- A JSON-based schema.
- 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 schema represents the documents in your collection.
Any document you insert into a MongoDB collection must be a JSON document.