MLstate / opalang

The Opa Language for Web Application Development
http://opalang.org
Other
1.24k stars 125 forks source link

Dbgen does not properly update variant types #156

Open HenriChataing opened 10 years ago

HenriChataing commented 10 years ago

Using MongoDb, updates on optional fields corrupt the database.

Test case : edited is an optional field of a record type stored in the database, and initially equals {none}. At some point, the field is updated :

/path/to/[..]/edited <- {some: Date.now()}

With the following result, in MongoDb :

 "edited" : {
    "none" : null,
    "some" : ISODate("2014-07-23T11:46:07.579Z")
 }