Addon default if record doesn't exist

Options

This is probably more of a feature request, but is there an easy way to define a default if an addon to a query function doesn't contain a record?

Currently, the way that several addon types work (aggregate, single), if no record(s) were found it simply leaves out the field entirely. This is just annoying when it's a "single" type addon, since I would expect it to include the field with a null value instead. For aggregation, though, it means that if no records were found to aggregate, rather then including the record with a "0" value, or a "0" count, it just doesn't include the fields at all, which means I have to manually map and add those fields if they're missing every time I make that query.

It's really just an annoyance, but also counter-intuitive. Unless I'm missing something and there is an option to define a "if no record(s) return X" value.

I'm currently just wrapping the entire query in it's own function where I can handle the necessary manipulation, but I would prefer that the extra manipulation isn't even necessary.

Answers