1 Resposta
- Mais recentes
- Mais votos
- Mais comentários
0
Hello. You could use the Javascript parseFloat() method and programmatically update those strings to double in the existing collection. Or use an $out stage in the aggregation and update the results afterwards. Something like this will loop through all documents in the collection and update the string:
db.collection.find({}).forEach( function(doc) {
doc.subDoc.stringVar = parseFloat( doc.subDoc.stringVar );
db.collection.update( { _id: doc._id }, {$set: { "subDoc.stringVar": doc.subDoc.stringVar } } )
});
respondido há 2 anos
Conteúdo relevante
- AWS OFICIALAtualizada há 8 meses
- Como solucionar problemas e resolver a utilização elevada da CPU em instâncias do Amazon DocumentDB?AWS OFICIALAtualizada há 8 meses
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há 2 meses