On calling the
insertOne() method on a collection for inserting documents, we are able to provide the fields and their respective attributes in the Mongo Shell while Compass GUI has a separate menu for selecting them. Are all the data types defaulted to something specific? and how can we specify data types in the CLI insertion methods (if at all possible)?
(N.B. A trivial observation. In the
insertOne() method lecture, when the attribute for the year field was added to the new document while inserting via shell, it was applied a double data type automatically while the remaining attributes were set to be strings.)