Hi Misha, Have you checked out https://issues.apache.org/jira/browse/METAMODEL-189 ? It seems you're not alone to think that MMs behaviour should be different here.
Myself I am torn. But let me explain my trail of thought on that issue, as a comment :-) Kasper 2015-11-26 13:06 GMT+01:00 mishadoff <[email protected]>: > Hello All, > > We encountered an issue where we can’t add new fields into MongoDB > collection, using MetaModel api because of schema validation. > > Initially in accounts table we have three fields [_id, name, createdDate] > and MetaModel is succesfully identified them by sampling. > DataSet ds = dc.query() > .from("accounts") > .selectAll() > .execute(); > System.out.println(ds.toRows()); // [_id, name, createdDate] > > dc.executeUpdate((c) -> { > c.insertInto("accounts") > //.value("_id", 123) _id will be autogenerated > .value("name", "default") > .value("createdDate", new Date()) > .value("active", false) > .execute(); > }); > After creating new document with the NEW active field, it complies = No > such column in table: active > > I understand that schema validation step is required for RDBMS sources, > and therefore MetaModel API requires it. > But is there simple way to bypass this check? > >
