There is actually a workaround to achieve this.
You can try to create two identical colleciton types (one will be called Paid and another Unpaid), you should name them differently but let them use the SAME table from db.
So now you should make something to filter the data in each collection, for that you can use beforeFind lifecycle hook.
**/models/Paid.js
module.exports = {
/**
* Triggered before find, so you can add an extra parameter to filter data
*/
lifecycles: {
async beforeFind(params,populate) {
params.paid = 1;
},
},
};
**/models/Unpaid.js
module.exports = {
/**
* Triggered before find, so you can add an extra parameter to filter data
*/
lifecycles: {
async beforeFind(params,populate) {
params.paid = 0;
},
},
};