mongodb int字段的一个小坑

在使用 php mongodb 搜索时,如果字段类型用 int,则使用 php 搜索时一定要把数值转换成整型来搜索,用字符串类型的数字搜索是没有结果的!!!!

$condition = ['memberCode': intval($memberCode)];
$result = $this->collection->find($condition);

猜你喜欢

转载自www.cnblogs.com/tujia/p/8940096.html