Duplicated key in meteor collection with mongodb

I'm currently develop an meteor app and sometimes my server goes down with this error:

Exception while invoking method '/songs/insert' MongoError: E11000 duplicate key error index: megan.songs.$id dup key: { : "399dc507-b1fe-4e0f-a2c4-fa3dabd2bdf5" }

The insert method is called in this way:

Songs.insert({name: vid, score: weight, title:title, listkey:Session.get('listkey')});

Can anybody help me?

Thanks in advance,

Topicus

Which key is getting duplicated? The ObjectId (_id) field can't be duplicating. Is it the listkey field? Probably you have a unique index set on the listkey field and somehow your Session.get() is returning an existing key and that's why your insert is failing..Can you execute:

db.Songs.find({listkey:"399dc507-b1fe-4e0f-a2c4-fa3dabd2bdf5"});

and check if there are mutiple documents returned?