MongoID Data Type for TEXT

Harsha M V picture Harsha M V · Feb 3, 2014 · Viewed 9.7k times · Source

Whats the best option to use for MongoID data type for the regular MongoDB TEXT data type.

Wondering why MongoID doesnt have a data type TEXT.

is it okay to use STRING type and store large amounts of data.

P.S coming from SQL background.

Answer

xlembouras picture xlembouras · Feb 3, 2014

According to the mongoid documentation all fields are strings, unless we explicitly specify an other data types. Unlike SQL's varchar and text differences, strings in mongo have no limitation (the only limitation is that of the 16MB maximum document size) so there is no need to worry about size.