{ sailsit }

Sails Js Tutorials for Beginners and Forum

Have a Question?

If you have any question you can ask below or enter what you are looking for!

Records creating with null properties


Home Forums ORM & Models Records creating with null properties

This topic contains 1 reply, has 2 voices, and was last updated by  tunaxor 9 months, 2 weeks ago.

  • Author
    Posts
  • #6273

    anterodev
    Participant

    Guys, why in sails 1.0, when i create a registry the values not passed are created as null?

    I have a model with FOO and BAR, not required, but unique. i inserted a object with just {foo: “test”}, but on db created: {foo: “test”, bar: “”}, and when i try to create {foo: “test2”} i get duplicate error on bar. understand?
    in sails 0.12, when i create {foo: “test”} just {foo: “test”} is inserted.

    Im using mongodb.

  • #6274

    tunaxor
    Participant

    did you try to lift your app with log level at “silly”? perhaps it logs to the console a warning/error
    also, sometimes (if you are using migrate: safe you have to manually enforce unique constraints in the database

You must be logged in to reply to this topic.