Syntax for json schema validation within Atlas?

@Stephen_Clark , I see you want to reuse the validator of existing collection . In that case

In mongo shell , you can use

var schema = db.getCollectionInfos({name: "users"})[0].options.validator;
db.createCollection("users1", { validator: schema } );

In driver, i see that getCollectionInfo isn’t available, so you can use listCollections instead

const filter = { name: 'users' };
const collectionInfos = await db.listCollections(filter).toArray();