PHP inserts 8 into the data using the Update method in the MONGO driver for an array of integers (such as the array, list:[1,3,4]), and becomes Numberlong (8).
Convert 8 to two classes defined in the driver: Mongoint32 and Mongoint64 are also not correct, this time the display is Numberint (8), Numberlong (8).
Inserting inside the MONGO shell is no problem, it is 8.
Thank you.
Reply content:
PHP inserts 8 into the data using the Update method in the MONGO driver for an array of integers (such as the array, list:[1,3,4]), and becomes Numberlong (8).
Convert 8 to two classes defined in the driver: Mongoint32 and Mongoint64 are also not correct, this time the display is Numberint (8), Numberlong (8).
Inserting inside the MONGO shell is no problem, it is 8.
Thank you.
Don't know exactly what type of data you need.
Insert integer number 8, becomes NumberInt(8)
not normal?
In the MONGO shell, the number defaults to the double type
$type-mongodb Manual 3.2
For example, if you insert the number 8, you can double
find the document with NUM as the type (that is, $type 1).test_doc
db.collection_example.insert({_id: 'test_doc', num: 8})db.collection_example.find({num: {$type: 1}})