I’ve seen in the mongosh documentation that you can provide a type hint when inserting data into a collection:
expectedType parameter doesn’t seem to be documented anywhere, in particular, it’s not on the reference manual page for
expectedType parameter still supported? And if so, can it also be used for
Last but not least, can someone please let me know how to find documentation on it?
It is not documented because it is not a parameter. It is there as an example so that you can verify in Compass or mongosh (with $type) that the store value is really the expectedType. The hint mentioned in your first link is the constructor Int32() as indicated by the sentence:
The Int32() constructor can be used to explicitly specify 32-bit integers.
Thanks. Somehow, I read that as being a param, when in fact, it was part of the first param’s JSON block…
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.