0

I create my first app in Grails 2.2.2 .. For database i am using MongoDb .. but it gives me an error if all fields are not filled..How to set mongoDb fields allows null

sagar mane
  • 123
  • 2
  • 13

2 Answers2

1

Have tried to set property of fields null-able

static constraints = { fieldName nullable: true }

1

By default GORM does not allow insert null value into database, but you can turn it off global by putting in Config.groovy: grails.gorm.default.constraints = { '*'(nullable: true) }