A small pit in the mongodb int field

When using php mongodb to search, if the field type is int, then when using php search, you must convert the numerical value into an integer type to search, and there is no result when you use a string type number to search! ! ! !

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

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324849098&siteId=291194637