5

In the documentation regarding built-in data types, it is written:

json: Any JSON-serializable value, including numbers, booleans, strings, arrays, dictionaries (plain JavaScript objects), and null.

ref: Any JavaScript value except undefined. (Should only be used when taking advantage of adapter-specific behavior.)

I can't figure out the difference between them. When to use one instead of the other?

Community
  • 1
  • 1
Julien Le Coupanec
  • 7,742
  • 9
  • 53
  • 67

1 Answers1

2

ref in conjunction with columnType can be used to represent native database data types, and use them, like binary data.

Check the following link for more information

https://sailsjs.com/documentation/concepts/models-and-orm/attributes#?columntype

Luis Lobo Borobia
  • 994
  • 11
  • 25