1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
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 } } )
});
답변함 2년 전
관련 콘텐츠
- AWS 공식업데이트됨 8달 전
- AWS 공식업데이트됨 8달 전