1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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 } } )
});
répondu il y a 2 ans
Contenus pertinents
- demandé il y a 7 mois
- demandé il y a un an
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 9 mois
- AWS OFFICIELA mis à jour il y a 9 mois