I have a content model that looks like:
{
"name": "content",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string",
"required": false
},
"data": {
"type": "Object",
"required": true
}
},
"validations": [],
"relations": {},
"acls": [
{
"accessType": "WRITE",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
],
"methods": {}
Example of this data in MySQL looks like this:

I've tried querying this data both with REST and the Node API and haven't been able to query by any of the nested object fields inside of the "data" database field. A few examples that don't work:
contentModel.findOne({ where: { "data.url": url } }, function (
err,
content
) {
if (err) {
console.log(err);
}
console.log("find:", content);
});
const filter = encodeURI(`{"where":{"systemid":"${contentType}"}}`);
let url = `${apiUrl}contentTypes?filter=${filter}`;
let contentTypeRecord = await this.getAxios().get(url);
I've also tried many queries in the loopback swagger ui. I usually get no results or it returns all the content records.
The above data access attempts do however work if I have the same data setup in MongoDb.
What am I doing wrong? Loopback should presumably be parsing the object in the data field and allowing me to filter on it.