Hello,
I have an Electron app with a Realm database using flexible sync.
I have this schema:
const EntrySchema = {
name: "Entry",
properties: {
_id: { type: "objectId", indexed: true },
cells: "Entry_cells[]",
},
primaryKey: "_id",
};
const Entry_cellsSchema = {
name: "Entry_cells",
embedded: true,
properties: {
_schema: { type: "int", optional: true, default: 0 },
body: { type: "string", optional: true, default: "" },
columnId: { type: "string", optional: true, default: "" },
},
};
I would like to be able to sort entries by cells.body. I know this is possible with an aggregation.
But I’m offline so I can’t use aggregate.
I would like to do something like the following but I’m afraid it is not supported:
.objects("entries")
.filtered("cells.columnId == $0", columnId)
.sorted([["cells.body", true]["_id", true]]);
Does anyone know if it can be achieved? Thanks.