db.test.find().sort({x:1}); { "_id" : ObjectId("4b03155dce8de6586fb002c7"), "x" : 2.9 } { "_id" : ObjectId("4b03154cce8de6586fb002c6"), "x" : 3 } { "_id" : ObjectId("4b031566ce8de6586fb002c9"), "x" : true } { "_id" : ObjectId("4b031563ce8de6586fb002c8"), "x" : "Tue Nov 17 2009 16:28:03 GMT-0500 (EST)" } The $type operator provides access to BSON type comparison in the MongoDB query syntax. See the documentation on BSON types and the $type operator for additional information. Warning: Data models that associate a field name with different data types within a collection are strongly discouraged. Without internal consistency complicates application code, and can lead to unnecessary complexity for application developers. The $mul multiplies the numeric value of a field by a number. For multiplication with values of mixed numeric types (32-bit integer, 64-bit integer, float), the following type conversion rules apply: Different query operators treat null values differently. Consider the collection test with the following documents: { _id: 1, cancelDate: null } { _id: 2 } The { cancelDate : null } query matches documents that either contain the cancelDate field whose value is null or that do not contain the cancelDate field. If the queried index is sparse (page 505), however, then the query will only match null values, not missing fields. Changed in version 2.6: If using the sparse index results in an incomplete result, MongoDB will not use the index unless a hint() explicitly specifies the index. See Sparse Indexes (page 505) for more information. Given the following query: Chapter 11. Frequently Asked Questions 752 Comparison with Null 11.2.15 How do I query for fields that have null values? Note: 11.2.14 When multiplying values of mixed types, what type conversion rules apply? See also: • The Tailable Cursors (page 123) page for an example of a C++ use of MinKey . • If the product of two 32-bit integers exceeds the maximum value for a 32-bit integer, the result is a 64-bit integer. • Integer operations of any type that exceed the maximum value for a 64-bit integer produce an error. 32-bit Integer 64-bit Integer Float 32-bit Integer 32-bit or 64-bit Integer 64-bit Integer Float 64-bit Integer 64-bit Integer 64-bit Integer Float Float Float Float Float MongoDB Documentation, Release 3.0.4