Create collection with schema validation

Is there a way to create a collection that include schema validations.

I have 2 collections (job , company). My job collection have “companyId” field and I want to validate that is an existing id on company collection.

The create collection api takes a CreateCollectionOptions as second parameter which allows you to specify a Validator. This was answered here.