schema usage in a collection

In the case that i want to define a schema with indexes in a collection ,which schemausage propertie schould i set?


Does schemausage=‘required’ mean that, every file that i save in this collection needs a schema?

You are correct, if you create a collection with schemausage=‘required’, then this means that when you store an instance into that particular collection there must be a corresponding schema for it.

If you want to use the collection for storing other document types that do not need validating againest a schema then you can create the collection with schemausage of optional.

Hope this helps.