Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5882

Document string aliases for $type

      SERVER-18819 introduced string aliases for the $type query operator. Whereas previously you could query for, say, all documents where field a is a NumberLong using

      db.coll.find({a: {$type: 18}});
      

      now you can use the much more readable

      db.coll.find({a: {$type: "long"}});
      

      The string alias accepted for each BSONType are listed in SERVER-18819. We need to add these to the $type docs here: http://docs.mongodb.org/manual/reference/operator/query/type/

      We should also consider updating http://docs.mongodb.org/manual/reference/bson-types/ to list the short names for each type.

            Assignee:
            ravind.kumar Ravind Kumar (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              8 years, 26 weeks, 1 day ago