MongoDB C# Unique field giving error with values that don't exists -
so, i've field mongodb declared unique, reasons, if gives error after inserting second record, saying "unique" field used.
this code create index.
var tablenumber = new stringfielddefinition<table>("number"); var tablenumberindexdefinition = new indexkeysdefinitionbuilder<table>().ascending(tablenumber); tables.indexes.createoneasync(tablenumberindexdefinition, options);
this exception get:
"a write operation resulted in error.\r\n e11000 duplicate key error collection: restovationdb.tables index:number_1 dup key: { : null }]",
when insert first entity have no problems when try inserting second one, gives me exception above, ideas ?
Comments
Post a Comment