As far as I can tell it is not possible to use array (or boolean?) types in models, e.g.
var Person = {
name: 'STRING',
age: 'INTEGER',
phones: [ { mobile: 'BOOLEAN', number: 'STRING' } ]
};
Is this lack of attribute types a design choice or are there plans for added these types?
we added the array type a few days ago: https://github.com/balderdashy/waterline/issues/30#issuecomment-19730397
We have to manage adding types with how they will be implemented across various adapters. If it's possible to to do I will add a type but if it takes a lot of hacking on all the adapters it's prob. not worth adding. You can see all the supported types here: https://github.com/balderdashy/waterline/blob/master/lib/waterline/utils/types.js
That is perfect! Thanks for taking the time to reply.
At some point it would probably make sense to include functions for querying and manipulating model array types directly in waterline. E.g. pushing a new value to array, popping values from array or query for value in array (like MongoDB's array operators)
I can't find documentation anywhere on how to use the attribute type 'array'
I'd like to merely create the following:
location: [Number, Number]
Would be glad if anyone could point me to the docs for this.
Thanks
Most helpful comment
I can't find documentation anywhere on how to use the attribute type 'array'
I'd like to merely create the following:
location: [Number, Number]
Would be glad if anyone could point me to the docs for this.
Thanks