0
votes

I'm trying to store a large chunk of text as part of a model in Sails.js. However, it seems that the text is getting cut off after some length. Is there a limit set on how long the 'string' type can hold in a model? If so, what's the best way around it? For reference, I'm using sails-mysql as an adapter.

2

2 Answers

2
votes

Yes, String is only 255 chars long on default (because thats the default length in the most databases).

Try to use

myfield: {
    type: "text"
}

As attribute - this should work.

(See: http://beta.sailsjs.org/#/documentation/reference/Models/Attributes.html)

0
votes

Try to use field: { type: 'ref' } this creates longtext in mysql .