0

I'm trying to understand why 3 of my collections is failing during the migration. I got the error Execute bulk failed with errors: ‘invalid document for insert: empty key' but didn't managed to understand and solve this issue.

I'm using DocumentDB both source DB and target.

Does someone know this error?

Nir Berko
  • 1,368
  • 1
  • 13
  • 33
  • Hi Nir, do any of your collections have documents where one of the fields is empty? For example - { "_id" : ObjectId("5fbf9b5b34b63125fa4f03f8"), "name" : "Mary", "" : "SEA" } In this document, the field 'name' has a value of 'Mary', but the second field is empty. – meet-bhagdev Dec 16 '20 at 23:17
  • Thank meet-bhagdev! But do you know how to fix it? – PaPu Jul 09 '21 at 09:21

1 Answers1

0

Find the documents using db..find({"": { $exists: true}}). Perform an update() using $unset to remove the empty-named field entirely.

tmcallaghan
  • 1,292
  • 2
  • 10
  • 20