I'm trying to create a schema in MongoDB using deno_mongo for deno and MongoDB rust dive for rust but I cannot figure out if it is possible.
I want to execute something similar to this in Mongo CLI
db.createCollection('test',{
validator: {
$jsonSchema: {
bsonType: 'object',
required:['field1', 'field2'],
properties:{
field1: {
bsonType:'string',
description:'enter field1'
},
field2: {
bsonType:'string',
description:'enter field2'
}
}
);