I've noticed that if I define a field as type
integer I'm allowed to insert values as either strings-of-integers or integers. And when I pull these values back out, they come back in the same form.
I'd like my integers to all be saved as integers, converting as necessary. Is this possible? Am I misunderstanding numeric field types?
For filtering and querying, the integer and string-of-integer values act the same. (good!)
They are not the same for json output. (maybe bad!)
They are not the same in groovy. (e.g.
In my application, I have a groovy script to do conditional inserts and removals into an array of values in a document, short-circuiting to a no-op (
ctx.op="none") if the value is (not) already present -- treating an array of label_ids as a set. This logic gets broken if given a mix of integers and strings-of-integers.
Any pointers would be appreciated.