1 Risposta
- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
0
AWS DocumentDB is a MongoDB-compatible database service, and it uses the BSON ObjectId format to generate unique identifiers for documents. The ObjectId format is a 12-byte binary value that consists of a timestamp, a machine identifier, a process identifier, and a counter.
But it looks like you are overwriting that in migration, there are 2 ways to handle that, you can insert new documents with an empty _id field and let DocumentDB generate a new ObjectId for each document.
Alternatively, you can generate new ObjectId values using Object mapping rules and following these steps:
Add new transformation rule for _id, use Expression Rule type. JavaScript code to generate a new ObjectId something like this
ObjectId(`${new Date().getTime().toString(16)}${Math.floor(Math.random()*10000000000000000).toString(16).padStart(16, '0')}`)
con risposta un anno fa
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 5 mesi fa
- AWS UFFICIALEAggiornata un anno fa