im getting 'E11000' error while i'm trying to create second record (for TipSchema) in my database. My models looks like this:
var TipSchema = new mg.Schema({
created: String,
title: String,
toWin: String,
stake: String,
imagecover: String,
tipcontext: String,
isFree: String,
result: String
});
var UserSchema = new mg.Schema({
username: {type: String, required: true, index: true, unique: true},
password: String,
mail: String
});
Error: "E11000 duplicate key error index: x.y.$username_1 dup key: { : null }' }"
my indexes looks like this:
INDEXED FIELD(S) UNIQUE SPARSE TTL SIZE { "_id": 1 } (true) (false) - 7.98 KB { "username": 1 } true (false) - 7.98 KB
What should i do to get this going? Few days ago i didn't have this problem, is that caused by "DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead."?
I've dropped entire db, and made everything again, but didn't help.