Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6219

use ::mongo in macros

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.3
    • Affects Version/s: None
    • Component/s: Internal Client
    • Labels:
    • Fully Compatible

      If there is a cascaded mongo namespace in your project BSON and BSON_ARRAY macros won't work any more.

      namespace foo { namespace mongo {
      
      void bar()
      {
        ::mongo::BSONObj bo = BSON("id" << 1);
      }
      
      } }
      

      The macro should use ::mongo instead

      #define BSON(x) (( ::mongo::BSONObjBuilder(64) << x ).obj())
      #define BSON_ARRAY(x) (( ::mongo::BSONArrayBuilder() << x ).arr())
      

            Assignee:
            phillip.quiza Phillip Quiza
            Reporter:
            dschneider David Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: