Is it possible to cast in a MongoDB-Query?

前端 未结 5 1305
醉梦人生
醉梦人生 2020-12-01 18:13

When I have two MongoDB documents like this...

db.test.insert( {\"value\" : \"10123\"} );
db.test.insert( {\"value\" : \"160\"} );

The resu

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 18:51

    $gt wasn't set for this use case. You would have to use regex for strings. Probably easier to just create a new field with the number as a number.

提交回复
热议问题