Convert a string to a number in MongoDB projection

后端 未结 3 668
谎友^
谎友^ 2020-12-10 06:05

I have a collection of documents that have a value that is known to be a number, but is stored as a string. It is out of my control to change the type of the field, but I w

3条回答
  •  执念已碎
    2020-12-10 06:33

    Now there is $toInt conversion operators in aggregation, you can check: https://jira.mongodb.org/browse/SERVER-11400

提交回复
热议问题