MongoDB - Error: getMore command failed: Cursor not found
问题 I need to create a new field sid on each document in a collection of about 500K documents. Each sid is unique and based on that record's existing roundedDate and stream fields. I'm doing so with the following code: var cursor = db.getCollection('snapshots').find(); var iterated = 0; var updated = 0; while (cursor.hasNext()) { var doc = cursor.next(); if (doc.stream && doc.roundedDate && !doc.sid) { db.getCollection('snapshots').update({ "_id": doc['_id'] }, { $set: { sid: doc.stream.valueOf()