I have a model like this:
var organization = new Schema({
things:[
{a:{
b:string
}
}
]
})
And I am trying to findOne with Mongoose like this:
let organization = await Organization.findOne({
"things.a.b": "uniquestring",
});
But the problem is that a may be null.
I would like to do something like this:
let organization = await Organization.findOne({
"things.a?.b": "uniquestring",
});
Is there a way to check for null on this query?