Mongodb inserts the value of int type as a type change

  mongodb, question

NumberLong(1),

NumberInt(1),

The insertion method is the same. Why are 64 bits and 32 bits
It seems that when i query used (int)$value to query the 64-bit
How can it be solved

Int and long are two different types in bson. if db.xxx.find ({value “:1}) is used, both can be found