views:

17

answers:

1

I'd like to add some default values to a model when I'm creating a new entry (like a timestamp)

I'm sure there are more than one way of doing this, I'm curious what the different ways are, but mostly what the standard way of doing this is.

Thanks

---edit---

solution:

for the timestamp the default would be

default: CURRENT_TIMESTAMP 
+3  A: 

Use the default key in your schema, like this:

felhasznalok_kezelese:  { type: boolean, default: false }

Works for all field types.

Maerlyn
Thanks! I'll definitely 'felhasznalok' this
Daniel