@@ -654,16 +654,16 @@ typeof question.answer; // 'bigint'
654654### Double {#double}
655655
656656Mongoose supports [ 64-bit IEEE 754-2008 floating point numbers] ( https://en.wikipedia.org/wiki/IEEE_754-2008_revision ) as a SchemaType.
657- Int32s are stored as [ BSON type "double" in MongoDB] ( https://www.mongodb.com/docs/manual/reference/bson-types/ ) .
657+ Doubles are stored as [ BSON type "double" in MongoDB] ( https://www.mongodb.com/docs/manual/reference/bson-types/ ) .
658658
659659``` javascript
660- const studentsSchema = new Schema ({
661- id : Double
660+ const temperatureSchema = new Schema ({
661+ celsius : Double
662662});
663- const Student = mongoose .model (' Student ' , schema );
663+ const Temperature = mongoose .model (' Temperature ' , temperatureSchema );
664664
665- const student = new Temperature ({ celsius: 1339 });
666- typeof student . id ; // 'number'
665+ const temperature = new Temperature ({ celsius: 1339 });
666+ typeof temperature . celsius ; // 'number'
667667```
668668
669669There are several types of values that will be successfully cast to a Double.
@@ -688,12 +688,12 @@ Mongoose supports 32-bit integers as a SchemaType.
688688Int32s are stored as [ 32-bit integers in MongoDB (BSON type "int")] ( https://www.mongodb.com/docs/manual/reference/bson-types/ ) .
689689
690690``` javascript
691- const studentsSchema = new Schema ({
691+ const studentSchema = new Schema ({
692692 id: Int32
693693});
694- const Student = mongoose .model (' Student' , schema );
694+ const Student = mongoose .model (' Student' , studentSchema );
695695
696- const student = new Temperature ({ celsius : 1339 });
696+ const student = new Student ({ id : 1339 });
697697typeof student .id ; // 'number'
698698```
699699
0 commit comments