geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

Defining the fields of an object property, as properties #142

Closed daviddias closed 8 months ago

daviddias commented 10 years ago

@mde is it possible to define which properties I want inside an object property?

Something like

this.property{"myobj", {
  a: "string",
  b: "number",
});

?

ben-ng commented 10 years ago

i don't think this is supported out of the box.

you can write your own custom validator to do this.

mde commented 10 years ago

If you have an actual data definition, this seems like something you'd use associations for.

daviddias commented 10 years ago

@mde I might go with that direction, however I prefered to not normalize the data, its not that big